Why make donate

license:update-file-header

Full name:

org.nuiton:maven-license-plugin:3.0:update-file-header

Description:

The goal to update (or add) the header on project source files.

This goal replace the update-header goal which can not deal with Copyright.

This goal use a specific project file descriptor project.xml to describe all files to update for a whole project.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Since version: 2.1.

Required Parameters

Name Type Since Description
encoding String 2.1 Encoding used to read and writes files.

Note: If nothing is filled here, we will use the system property file.encoding.
Default value is: ${project.build.sourceEncoding}.
inceptionYear String 2.1 Inception year of the project.

Will be used as first year of copyright section in new header.
Default value is: ${project.inceptionYear}.
organizationName String 2.1 Name of project's organization.

Will be used as copyrigth's holder in new header.
Default value is: ${project.organization.name}.
project MavenProject 2.1 The reacted project.
Default value is: ${project}.
projectName String 2.1 Name of project (or module).

Will be used as description section of new header.
Default value is: ${project.name}.

Optional Parameters

Name Type Since Description
addSvnKeyWords boolean 2.1 A flag to add svn:keywords on new header.

Will add svn keywords :
Author, Id, Rev, URL and Date

Default value is: false.
canUpdateCopyright boolean 2.3.2 A flag to authorize update of the copyright part of the header.

Note: By default, do NOT authorize it since copyright part should be handled by developpers (holder can change on each file for example).
Default value is: false.
canUpdateDescription boolean 2.3.2 A flag to authorize update of the description part of the header.

Note: By default, do NOT authorize it since description can change on each file).
Default value is: false.
canUpdateLicense boolean 2.3.2 A flag to authorize update of the license part of the header.

Note: By default, authorize it since license part should always be generated by the plugin.
Default value is: true.
clearAfterOperation boolean 2.1 A flag to clear everything after execution.

Note: This property should ONLY be used for test purpose.
Default value is: true.
dryRun boolean 2.1 A flag to test plugin but modify no file.
Default value is: false.
excludes String[] 2.4 Specific files to excludes, separated by a comma. By default, thoses file type are excluded:
  • modelisation
  • images

Note: This parameter is not useable if you are still using a project file descriptor.
extraExtensions Map 2.4.1 To associate extra extension files to an existing comment style.

Keys of the map are the extension of extra files to treate, and the value is the comment style you want to associate.

For example, to treate file with extensions java2 and jdata as java files (says using the java comment style, declare this in your plugin configuration :
<extraExtensions>
<java2>java</java2>
<jdata>java</jdata>
</extraExtensions>

Note: This parameter is not useable if you are still using a project file descriptor.
ignoreTag String 2.1 A tag to place on files that will be ignored by the plugin.

Sometimes, it is necessary to do this when file is under a specific license.

Note: If no sets, will use the default tag %%Ignore-License
includes String[] 2.4 Specific files to includes, separated by a comma. By default, it is "** /*".

Note: This parameter is not useable if you are still using a project file descriptor.
keepBackup boolean 2.1 A flag to keep a backup of every modified file.
Default value is: false.
licenseName String 2.4 Name of the license to use in the project.
licenseResolver String 2.1 To specify an external extra licenses repository resolver (says the base url of the repository where the license.properties is present).
roots String[] 2.4 To specify the base dir from which we apply the license.

Should be on form "root1,root2,rootn".

By default, the main roots are "src, target/generated-sources, target/processed-sources".

Note: If some of these roots do not exist, they will be simply ignored.

Note: This parameter is not useable if you are still using a project file descriptor.
skipUpdateLicense boolean 2.1 A flag to skip the goal.
Default value is: false.
updateCopyright boolean 2.1 A flag to update copyright application time (change copyright last year if required) according to the last commit made on the processed file.
Default value is: false.
verbose boolean 2.1 Flag to activate verbose mode.

Note: Verbose mode is always on if you starts a debug maven instance (says via -X).
Default value is: ${maven.verbose}.

Parameter Details

addSvnKeyWords:

A flag to add svn:keywords on new header.

Will add svn keywords :
Author, Id, Rev, URL and Date
  • Type: boolean
  • Since: 2.1
  • Required: No
  • Expression: ${license.addSvnKeyWords}
  • Default: false

canUpdateCopyright:

A flag to authorize update of the copyright part of the header.

Note: By default, do NOT authorize it since copyright part should be handled by developpers (holder can change on each file for example).
  • Type: boolean
  • Since: 2.3.2
  • Required: No
  • Expression: ${license.canUpdateCopyright}
  • Default: false

canUpdateDescription:

A flag to authorize update of the description part of the header.

Note: By default, do NOT authorize it since description can change on each file).
  • Type: boolean
  • Since: 2.3.2
  • Required: No
  • Expression: ${license.canUpdateDescription}
  • Default: false

canUpdateLicense:

A flag to authorize update of the license part of the header.

Note: By default, authorize it since license part should always be generated by the plugin.
  • Type: boolean
  • Since: 2.3.2
  • Required: No
  • Expression: ${license.canUpdateLicense}
  • Default: true

clearAfterOperation:

A flag to clear everything after execution.

Note: This property should ONLY be used for test purpose.
  • Type: boolean
  • Since: 2.1
  • Required: No
  • Expression: ${license.clearAfterOperation}
  • Default: true

dryRun:

A flag to test plugin but modify no file.
  • Type: boolean
  • Since: 2.1
  • Required: No
  • Expression: ${dryRun}
  • Default: false

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: 2.1
  • Required: Yes
  • Expression: ${license.encoding}
  • Default: ${project.build.sourceEncoding}

excludes:

Specific files to excludes, separated by a comma. By default, thoses file type are excluded:
  • modelisation
  • images

Note: This parameter is not useable if you are still using a project file descriptor.
  • Type: java.lang.String[]
  • Since: 2.4
  • Required: No
  • Expression: ${license.excludes}

extraExtensions:

To associate extra extension files to an existing comment style.

Keys of the map are the extension of extra files to treate, and the value is the comment style you want to associate.

For example, to treate file with extensions java2 and jdata as java files (says using the java comment style, declare this in your plugin configuration :
<extraExtensions>
<java2>java</java2>
<jdata>java</jdata>
</extraExtensions>

Note: This parameter is not useable if you are still using a project file descriptor.
  • Type: java.util.Map
  • Since: 2.4.1
  • Required: No

ignoreTag:

A tag to place on files that will be ignored by the plugin.

Sometimes, it is necessary to do this when file is under a specific license.

Note: If no sets, will use the default tag %%Ignore-License
  • Type: java.lang.String
  • Since: 2.1
  • Required: No
  • Expression: ${license.ignoreTag}

inceptionYear:

Inception year of the project.

Will be used as first year of copyright section in new header.
  • Type: java.lang.String
  • Since: 2.1
  • Required: Yes
  • Expression: ${license.inceptionYear}
  • Default: ${project.inceptionYear}

includes:

Specific files to includes, separated by a comma. By default, it is "** /*".

Note: This parameter is not useable if you are still using a project file descriptor.
  • Type: java.lang.String[]
  • Since: 2.4
  • Required: No
  • Expression: ${license.includes}

keepBackup:

A flag to keep a backup of every modified file.
  • Type: boolean
  • Since: 2.1
  • Required: No
  • Expression: ${license.keepBackup}
  • Default: false

licenseName:

Name of the license to use in the project.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • Expression: ${license.licenseName}

licenseResolver:

To specify an external extra licenses repository resolver (says the base url of the repository where the license.properties is present).
  • Type: java.lang.String
  • Since: 2.1
  • Required: No
  • Expression: ${license.licenseResolver}

organizationName:

Name of project's organization.

Will be used as copyrigth's holder in new header.
  • Type: java.lang.String
  • Since: 2.1
  • Required: Yes
  • Expression: ${license.organizationName}
  • Default: ${project.organization.name}

project:

The reacted project.
  • Type: org.apache.maven.project.MavenProject
  • Since: 2.1
  • Required: Yes
  • Default: ${project}

projectName:

Name of project (or module).

Will be used as description section of new header.
  • Type: java.lang.String
  • Since: 2.1
  • Required: Yes
  • Expression: ${license.projectName}
  • Default: ${project.name}

roots:

To specify the base dir from which we apply the license.

Should be on form "root1,root2,rootn".

By default, the main roots are "src, target/generated-sources, target/processed-sources".

Note: If some of these roots do not exist, they will be simply ignored.

Note: This parameter is not useable if you are still using a project file descriptor.
  • Type: java.lang.String[]
  • Since: 2.4
  • Required: No
  • Expression: ${license.roots}

skipUpdateLicense:

A flag to skip the goal.
  • Type: boolean
  • Since: 2.1
  • Required: No
  • Expression: ${license.skipUpdateLicense}
  • Default: false

updateCopyright:

A flag to update copyright application time (change copyright last year if required) according to the last commit made on the processed file.
  • Type: boolean
  • Since: 2.1
  • Required: No
  • Expression: ${license.updateCopyright}
  • 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: 2.1
  • Required: No
  • Expression: ${license.verbose}
  • Default: ${maven.verbose}
Maven JRst ReStructuredText