Fork me on GitHub

license:update-project-license

Full name:

org.codehaus.mojo:license-maven-plugin:2.4.0:update-project-license

Description:

Updates (or creates) the main project license file according to the given license defines as licenseName. Can also generate a bundled license file (to avoid collision names in class-path). This file is by default generated in META-INF class-path directory.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Since version: 1.0.
  • Binds by default to the lifecycle phase: generate-resources.

Required Parameters

Name Type Since Description
<inceptionYear> Integer 1.0 Inception year of the project.

Will be used as first year of copyright section in new header.


Default: ${project.inceptionYear}
User Property: license.inceptionYear
<organizationName> String 1.0 Name of project's organization.

Will be used as copyright's holder in new header.


Default: ${project.organization.name}
User Property: license.organizationName
<projectName> String 1.0 Name of project (or module).

Will be used as description section of new header.


Default: ${project.name}
User Property: license.projectName

Optional Parameters

Name Type Since Description
<bundleLicensePath> String 1.0 The path of the bundled license file to produce when generateBundle is on. Note: This option is not available for pom module types.
Default: META-INF/${project.artifactId}-LICENSE.txt
User Property: license.bundleLicensePath
<copyrightOwners> String 1.6 optional copyright owners.

If not set, organizationName parameter will be used instead.


User Property: license.copyrightOwners
<copyrightStringFormat> String 2.1.0 optional copyright string format

If not set, "Copyright (C) %1$s %2$s" is used where the copyright dates are substituted for $1 and the copyright holder for $2.


User Property: license.copyrightStringFormat
<encoding> String 1.0 Encoding used to read and writes files. Note: If nothing is filled here, we will use the system property file.encoding.
Default: ${project.build.sourceEncoding}
User Property: license.encoding
<extraTemplateParameters> Map<String,String> 1.6 optional extra templates parameters.

If filled, they are available with prefix extra_ to process license content (says the header and license content).

<force> boolean 1.0.0 A flag to force to generate project license file even if it is up-to-date.
Default: false
User Property: license.force
<generateBundle> boolean 1.0 A flag to copy the main license file in a bundled place. This is usefull for final application to have a none confusing location to seek for the application license. If Sets to true, will copy the license file to the bundleLicensePath to outputDirectory. Note: This option is not available for pom module types.
Default: false
User Property: license.generateBundle
<ignoreLastDate> boolean 2.3.0 Ignore the last date for copyright year range.
Default: false
User Property: license.ignoreLastDate
<keepBackup> boolean 1.0 A flag to keep a backup of every modified file.
Default: false
User Property: license.keepBackup
<licenseFile> File 1.0 Project license file to synchronize with main license defined in descriptor file.
Default: ${basedir}/LICENSE.txt
User Property: license.licenceFile
<licenseName> String 1.0 Name of the license to use in the project.
User Property: license.licenseName
<licenseResolver> String 1.0 To specify an external extra licenses repository resolver (says the base url of the repository where the license.properties is present).

Note: If you want to refer to a file within this project, start the expression with ${project.baseUri}


User Property: license.licenseResolver
<outputDirectory> File 1.0 The directory where to generate license resources. Note: This option is not available for pom module types.
Default: target/generated-sources/license
User Property: license.outputDirectory
<skipUpdateProjectLicense> boolean 1.0 A flag to skip the goal.
Default: false
User Property: license.skipUpdateProjectLicense
<verbose> boolean 1.0 Flag to activate verbose mode. Note: Verbose mode is always on if you starts a debug maven instance (says via -X).
Default: ${maven.verbose}
User Property: license.verbose

Parameter Details

<bundleLicensePath>

The path of the bundled license file to produce when generateBundle is on. Note: This option is not available for pom module types.
  • Type: java.lang.String
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.bundleLicensePath
  • Default: META-INF/${project.artifactId}-LICENSE.txt

<copyrightOwners>

optional copyright owners.

If not set, organizationName parameter will be used instead.

  • Type: java.lang.String
  • Since: 1.6
  • Required: report.plugin.goal.no
  • User Property: license.copyrightOwners

<copyrightStringFormat>

optional copyright string format

If not set, "Copyright (C) %1$s %2$s" is used where the copyright dates are substituted for $1 and the copyright holder for $2.

  • Type: java.lang.String
  • Since: 2.1.0
  • Required: report.plugin.goal.no
  • User Property: license.copyrightStringFormat

<encoding>

Encoding used to read and writes files. Note: If nothing is filled here, we will use the system property file.encoding.
  • Type: java.lang.String
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.encoding
  • Default: ${project.build.sourceEncoding}

<extraTemplateParameters>

optional extra templates parameters.

If filled, they are available with prefix extra_ to process license content (says the header and license content).

  • Type: java.util.Map<java.lang.String, java.lang.String>
  • Since: 1.6
  • Required: report.plugin.goal.no

<force>

A flag to force to generate project license file even if it is up-to-date.
  • Type: boolean
  • Since: 1.0.0
  • Required: report.plugin.goal.no
  • User Property: license.force
  • Default: false

<generateBundle>

A flag to copy the main license file in a bundled place. This is usefull for final application to have a none confusing location to seek for the application license. If Sets to true, will copy the license file to the bundleLicensePath to outputDirectory. Note: This option is not available for pom module types.
  • Type: boolean
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.generateBundle
  • Default: false

<ignoreLastDate>

Ignore the last date for copyright year range.
  • Type: boolean
  • Since: 2.3.0
  • Required: report.plugin.goal.no
  • User Property: license.ignoreLastDate
  • Default: false

<inceptionYear>

Inception year of the project.

Will be used as first year of copyright section in new header.

  • Type: java.lang.Integer
  • Since: 1.0
  • Required: report.plugin.goal.yes
  • User Property: license.inceptionYear
  • Default: ${project.inceptionYear}

<keepBackup>

A flag to keep a backup of every modified file.
  • Type: boolean
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.keepBackup
  • Default: false

<licenseFile>

Project license file to synchronize with main license defined in descriptor file.
  • Type: java.io.File
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.licenceFile
  • Default: ${basedir}/LICENSE.txt

<licenseName>

Name of the license to use in the project.
  • Type: java.lang.String
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.licenseName

<licenseResolver>

To specify an external extra licenses repository resolver (says the base url of the repository where the license.properties is present).

Note: If you want to refer to a file within this project, start the expression with ${project.baseUri}

  • Type: java.lang.String
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.licenseResolver

<organizationName>

Name of project's organization.

Will be used as copyright's holder in new header.

  • Type: java.lang.String
  • Since: 1.0
  • Required: report.plugin.goal.yes
  • User Property: license.organizationName
  • Default: ${project.organization.name}

<outputDirectory>

The directory where to generate license resources. Note: This option is not available for pom module types.
  • Type: java.io.File
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.outputDirectory
  • Default: target/generated-sources/license

<projectName>

Name of project (or module).

Will be used as description section of new header.

  • Type: java.lang.String
  • Since: 1.0
  • Required: report.plugin.goal.yes
  • User Property: license.projectName
  • Default: ${project.name}

<skipUpdateProjectLicense>

A flag to skip the goal.
  • Type: boolean
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.skipUpdateProjectLicense
  • Default: false

<verbose>

Flag to activate verbose mode. Note: Verbose mode is always on if you starts a debug maven instance (says via -X).
  • Type: boolean
  • Since: 1.0
  • Required: report.plugin.goal.no
  • User Property: license.verbose
  • Default: ${maven.verbose}