license:remove

Full name:

com.mycila:license-maven-plugin:4.2.rc2:remove

Description:

Remove the specified header from source files

Attributes:

  • Requires a Maven project to be executed.

Required Parameters

Name Type Since Description
<defaultBasedir> File - The base directory, in which to search for project files.

This is named `defaultBaseDirectory` as it will be used as the default value for the base directory. This default value can be overridden in each LicenseSet by setting LicenseSet.basedir.


Default value is: ${project.basedir}.
User property is: license.basedir.
Alias is: basedir.
<dependencyEnforce> boolean - Whether to enforce license.dependencies.allow list.
Default value is: false.
User property is: license.dependencies.enforce.
<dependencyExceptionMessage> String - Exception message prefix to display when an artifact is denied by one of the license policies.
Default value is: Some licenses were denied by policy:.
User property is: license.dependencies.exceptionMessage.
<dependencyScopes> List - When enforcing licenses on dependencies, exclude all but these scopes.
Default value is: runtime.
User property is: license.dependencies.scope.
<project> MavenProject - (no description)
Default value is: ${project}.

Optional Parameters

Name Type Since Description
<aggregate> boolean - You can set this flag to true if you want to check the headers for all modules of your project. Only used for multi-modules projects, to check for example the header licenses from the parent module for all sub modules.
Default value is: false.
User property is: license.aggregate.
<concurrencyFactor> float - Maven license plugin uses concurrency to check license headers. This factor is used to control the number of threads used to check. The rule is:
<nThreads> = <number of cores> * concurrencyFactor
The default is 1.5.
Default value is: 1.5.
User property is: license.concurrencyFactor.
<defaultHeaderDefinitions> String[] - Allows the use of external header definitions files. These files are properties like files.

This is named `defaultHeaderDefinitions` as it will be used as the default value for the header definitions. This default value can be overridden in each LicenseSet by setting LicenseSet.headerDefinitions or LicenseSet.inlineHeaderStyles and is overridden by defaultInlineHeaderStyles.


Alias is: headerDefinitions.
<defaultInlineHeaderStyles> HeaderStyle[] - Allows the use of inline header definitions.

This is named `defaultInlineHeaderStyles` as it will be used as the default value for the header definitions.

This default value can be overridden in each LicenseSet by setting LicenseSet.headerDefinitions or LicenseSet.inlineHeaderStyles.

Inline styles overrides those read from file


<defaultProperties> Map - You can set here some properties that you want to use when reading the header file. You can use in your header file some properties like ${year}, ${owner} or whatever you want for the name. They will be replaced when the header file is read by those you specified in the command line, in the POM and in system environment.

This is named `defaultProperties` as it will be used as the default value for the properties. This default value can be overridden in each LicenseSet by setting LicenseSet.properties.


Alias is: properties.
<defaultUseDefaultExcludes> boolean - Specify if you want to use default exclusions besides the files you have excluded. Default exclusions exclude CVS and SVN folders, IDE descriptors and so on.

This is named `defaultUseDefaultExcludes` as it will be used as the default value for whether to use default excludes. This default value can be overridden in each LicenseSet by setting LicenseSet.useDefaultExcludes.


Default value is: true.
User property is: license.useDefaultExcludes.
Alias is: useDefaultExcludes.
<dependencyPolicies> Set - Block of LicensePolicy configuration for enforcing license adherence in dependencies.
User property is: license.dependencies.policies.
<dryRun> boolean - If dryRun is enabled, calls to license:format and license:remove will not overwrite the existing file but instead write the result to a new file with the same name but ending with `.licensed`.
Default value is: false.
User property is: license.dryRun.
<encoding> String - Specify the encoding of your files. Default to the project source encoding property (project.build.sourceEncoding).
Default value is: ${project.build.sourceEncoding}.
User property is: license.encoding.
<failIfMissing> boolean - You can set this flag to false if you do not want the build to fail when some headers are missing.
Default value is: true.
User property is: license.failIfMissing.
<failIfUnknown> boolean 2.8 You can leave this flag on false if you do not want the build to fail for files that do not have an implicit or explicit comment style definition. Setting this explicitly to true is a safe way to make sure that the effective file type mappings cover all files included from your project.

Default is false for backwards compatibility reasons.


Default value is: false.
User property is: license.failIfUnknown.
<legacyConfigExcludes> String[] - Deprecated. use LicenseSet.excludes
User property is: license.excludes.
Alias is: excludes.
<legacyConfigHeader> String - Deprecated. use LicenseSet.header
User property is: license.header.
Alias is: header.
<legacyConfigHeaderSections> HeaderSection[] - Deprecated. use LicenseSet.headerSections
Alias is: headerSections.
<legacyConfigIncludes> String[] - Deprecated. use LicenseSet.includes
User property is: license.includes.
Alias is: includes.
<legacyConfigInlineHeader> String - Deprecated. use LicenseSet.inlineHeader
User property is: license.inlineHeader.
Alias is: inlineHeader.
<legacyConfigKeywords> String[] - Deprecated. use LicenseSet.keywords
Alias is: keywords.
<legacyConfigMulti> Multi - Deprecated. use LicenseSet.multi
<legacyConfigValidHeaders> String[] - Deprecated. use LicenseSet.validHeaders
Alias is: validHeaders.
<licenseSets> LicenseSet[] - (no description)
<mapping> Map - Set mapping between document mapping and a supported type to use. This section is very useful when you want to customize the supported extensions. If your project is using file extensions not supported by default by this plugin, you can add a mapping to attach the extension to an existing type of comment. The tag name is the new extension name to support, and the value is the name of the comment type to use.
<nThreads> int - Maven license plugin uses concurrency to check license headers. With this option the number of threads used to check can be specified. If given it take precedence over concurrencyFactor

The default is 0 which implies that the default for concurrencyFactor is used.


Default value is: 0.
User property is: license.nThreads.
<quiet> boolean - If you do not want to see the list of file having a missing header, you can add the quiet flag that will shorten the output
Default value is: false.
User property is: license.quiet.
<reportFormat> String - Format of the report.

Can be (case-insensitive): 'xml', 'json'.

Default is XML.


User property is: license.report.format.
<reportLocation> File - The location where to write the report of the plugin execution (file processed, action taken, etc).

"PRESENT" means the file has a header (check goal)

"MISSING" means the header is missing (check goal)

"NOOP" means no action were performed (remove or format goal)

"ADDED" means a header was added (format goal)

"REPLACED" means a header was replaced (format goal)

"REMOVED" means a header was removed (format goal)

"UNKNOWN" means that the file extension is unknown

Activated by default.


Default value is: ${project.reporting.outputDirectory}/license-plugin-report.xml.
User property is: license.report.location.
<reportSkipped> boolean - Skip the report generation. Default: false
Default value is: false.
User property is: license.report.skip.
<session> MavenSession - (no description)
Default value is: ${session}.
<skip> boolean - Whether to skip the plugin execution
Default value is: false.
User property is: license.skip.
<skipExistingHeaders> boolean - Skip the formatting of files which already contain a detected header.
Default value is: false.
User property is: license.skipExistingHeaders.
<strictCheck> boolean - Set to true if you need a strict check against the headers. By default, the existence of a header is verified by taking the top portion of a file and checking if it contains the headers text, not considering special characters (spaces, tabs, ...).
We highly recommend to keep this option set to true.
Default value is: true.
User property is: license.strictCheck.
<useDefaultMapping> boolean - Whether to use the default mapping between file extensions and comment types, or only the one your provide.
Default value is: true.
User property is: license.useDefaultMapping.

Parameter Details

<aggregate>

You can set this flag to true if you want to check the headers for all modules of your project. Only used for multi-modules projects, to check for example the header licenses from the parent module for all sub modules.
  • Type: boolean
  • Required: No
  • User Property: license.aggregate
  • Default: false

<concurrencyFactor>

Maven license plugin uses concurrency to check license headers. This factor is used to control the number of threads used to check. The rule is:
<nThreads> = <number of cores> * concurrencyFactor
The default is 1.5.
  • Type: float
  • Required: No
  • User Property: license.concurrencyFactor
  • Default: 1.5

<defaultBasedir>

The base directory, in which to search for project files.

This is named `defaultBaseDirectory` as it will be used as the default value for the base directory. This default value can be overridden in each LicenseSet by setting LicenseSet.basedir.

  • Type: java.io.File
  • Required: Yes
  • User Property: license.basedir
  • Default: ${project.basedir}
  • Alias: basedir

<defaultHeaderDefinitions>

Allows the use of external header definitions files. These files are properties like files.

This is named `defaultHeaderDefinitions` as it will be used as the default value for the header definitions. This default value can be overridden in each LicenseSet by setting LicenseSet.headerDefinitions or LicenseSet.inlineHeaderStyles and is overridden by defaultInlineHeaderStyles.

  • Type: java.lang.String[]
  • Required: No
  • Alias: headerDefinitions

<defaultInlineHeaderStyles>

Allows the use of inline header definitions.

This is named `defaultInlineHeaderStyles` as it will be used as the default value for the header definitions.

This default value can be overridden in each LicenseSet by setting LicenseSet.headerDefinitions or LicenseSet.inlineHeaderStyles.

Inline styles overrides those read from file

  • Type: com.mycila.maven.plugin.license.HeaderStyle[]
  • Required: No

<defaultProperties>

You can set here some properties that you want to use when reading the header file. You can use in your header file some properties like ${year}, ${owner} or whatever you want for the name. They will be replaced when the header file is read by those you specified in the command line, in the POM and in system environment.

This is named `defaultProperties` as it will be used as the default value for the properties. This default value can be overridden in each LicenseSet by setting LicenseSet.properties.

  • Type: java.util.Map
  • Required: No
  • Alias: properties

<defaultUseDefaultExcludes>

Specify if you want to use default exclusions besides the files you have excluded. Default exclusions exclude CVS and SVN folders, IDE descriptors and so on.

This is named `defaultUseDefaultExcludes` as it will be used as the default value for whether to use default excludes. This default value can be overridden in each LicenseSet by setting LicenseSet.useDefaultExcludes.

  • Type: boolean
  • Required: No
  • User Property: license.useDefaultExcludes
  • Default: true
  • Alias: useDefaultExcludes

<dependencyEnforce>

Whether to enforce license.dependencies.allow list.
  • Type: boolean
  • Required: Yes
  • User Property: license.dependencies.enforce
  • Default: false

<dependencyExceptionMessage>

Exception message prefix to display when an artifact is denied by one of the license policies.
  • Type: java.lang.String
  • Required: Yes
  • User Property: license.dependencies.exceptionMessage
  • Default: Some licenses were denied by policy:

<dependencyPolicies>

Block of LicensePolicy configuration for enforcing license adherence in dependencies.
  • Type: java.util.Set
  • Required: No
  • User Property: license.dependencies.policies

<dependencyScopes>

When enforcing licenses on dependencies, exclude all but these scopes.
  • Type: java.util.List
  • Required: Yes
  • User Property: license.dependencies.scope
  • Default: runtime

<dryRun>

If dryRun is enabled, calls to license:format and license:remove will not overwrite the existing file but instead write the result to a new file with the same name but ending with `.licensed`.
  • Type: boolean
  • Required: No
  • User Property: license.dryRun
  • Default: false

<encoding>

Specify the encoding of your files. Default to the project source encoding property (project.build.sourceEncoding).
  • Type: java.lang.String
  • Required: No
  • User Property: license.encoding
  • Default: ${project.build.sourceEncoding}

<failIfMissing>

You can set this flag to false if you do not want the build to fail when some headers are missing.
  • Type: boolean
  • Required: No
  • User Property: license.failIfMissing
  • Default: true

<failIfUnknown>

You can leave this flag on false if you do not want the build to fail for files that do not have an implicit or explicit comment style definition. Setting this explicitly to true is a safe way to make sure that the effective file type mappings cover all files included from your project.

Default is false for backwards compatibility reasons.

  • Type: boolean
  • Since: 2.8
  • Required: No
  • User Property: license.failIfUnknown
  • Default: false

<legacyConfigExcludes>

Deprecated. use LicenseSet.excludes
Specifies files, which are excluded in the check. By default, only the files matching the default exclude patterns are excluded.
  • Type: java.lang.String[]
  • Required: No
  • User Property: license.excludes
  • Alias: excludes

<legacyConfigHeader>

Deprecated. use LicenseSet.header
Location of the header. It can be a relative path, absolute path, classpath resource, any URL. The plugin first check if the name specified is a relative file, then an absolute file, then in the classpath. If not found, it tries to construct a URL from the location.
  • Type: java.lang.String
  • Required: No
  • User Property: license.header
  • Alias: header

<legacyConfigHeaderSections>

Deprecated. use LicenseSet.headerSections
HeadSections define special regions of a header that allow for dynamic substitution and validation
  • Type: com.mycila.maven.plugin.license.HeaderSection[]
  • Required: No
  • Alias: headerSections

<legacyConfigIncludes>

Deprecated. use LicenseSet.includes
Specifies files, which are included in the check. By default, all files are included.
  • Type: java.lang.String[]
  • Required: No
  • User Property: license.includes
  • Alias: includes

<legacyConfigInlineHeader>

Deprecated. use LicenseSet.inlineHeader
Header, as text, directly in pom file. Using a CDATA section is strongly recommended.
  • Type: java.lang.String
  • Required: No
  • User Property: license.inlineHeader
  • Alias: inlineHeader

<legacyConfigKeywords>

Deprecated. use LicenseSet.keywords
Specify the list of keywords to use to detect a header. A header must include all keywords to be valid. By default, the word 'copyright' is used. Detection is done case insensitive.
  • Type: java.lang.String[]
  • Required: No
  • Alias: keywords

<legacyConfigMulti>

Deprecated. use LicenseSet.multi
Alternative to `header`, `inlineHeader`, or `validHeaders` for use when code is multi-licensed. Whilst you could create a concatenated header yourself, a cleaner approach may be to specify more than one header and have them concatenated together by the plugin. This allows you to maintain each distinct license header in its own file and combined them in different ways.
  • Type: com.mycila.maven.plugin.license.Multi
  • Required: No

<legacyConfigValidHeaders>

Deprecated. use LicenseSet.validHeaders
Specifies additional header files to use when checking for the presence of a valid header in your sources.
When using format goal, this property will be used to detect all valid headers that don't need formatting.
When using remove goal, this property will be used to detect all valid headers that also must be removed.
  • Type: java.lang.String[]
  • Required: No
  • Alias: validHeaders

<licenseSets>

(no description)
  • Type: com.mycila.maven.plugin.license.LicenseSet[]
  • Required: No

<mapping>

Set mapping between document mapping and a supported type to use. This section is very useful when you want to customize the supported extensions. If your project is using file extensions not supported by default by this plugin, you can add a mapping to attach the extension to an existing type of comment. The tag name is the new extension name to support, and the value is the name of the comment type to use.
  • Type: java.util.Map
  • Required: No

<nThreads>

Maven license plugin uses concurrency to check license headers. With this option the number of threads used to check can be specified. If given it take precedence over concurrencyFactor

The default is 0 which implies that the default for concurrencyFactor is used.

  • Type: int
  • Required: No
  • User Property: license.nThreads
  • Default: 0

<project>

(no description)
  • Type: org.apache.maven.project.MavenProject
  • Required: Yes
  • Default: ${project}

<quiet>

If you do not want to see the list of file having a missing header, you can add the quiet flag that will shorten the output
  • Type: boolean
  • Required: No
  • User Property: license.quiet
  • Default: false

<reportFormat>

Format of the report.

Can be (case-insensitive): 'xml', 'json'.

Default is XML.

  • Type: java.lang.String
  • Required: No
  • User Property: license.report.format

<reportLocation>

The location where to write the report of the plugin execution (file processed, action taken, etc).

"PRESENT" means the file has a header (check goal)

"MISSING" means the header is missing (check goal)

"NOOP" means no action were performed (remove or format goal)

"ADDED" means a header was added (format goal)

"REPLACED" means a header was replaced (format goal)

"REMOVED" means a header was removed (format goal)

"UNKNOWN" means that the file extension is unknown

Activated by default.

  • Type: java.io.File
  • Required: No
  • User Property: license.report.location
  • Default: ${project.reporting.outputDirectory}/license-plugin-report.xml

<reportSkipped>

Skip the report generation. Default: false
  • Type: boolean
  • Required: No
  • User Property: license.report.skip
  • Default: false

<session>

(no description)
  • Type: org.apache.maven.execution.MavenSession
  • Required: No
  • Default: ${session}

<skip>

Whether to skip the plugin execution
  • Type: boolean
  • Required: No
  • User Property: license.skip
  • Default: false

<skipExistingHeaders>

Skip the formatting of files which already contain a detected header.
  • Type: boolean
  • Required: No
  • User Property: license.skipExistingHeaders
  • Default: false

<strictCheck>

Set to true if you need a strict check against the headers. By default, the existence of a header is verified by taking the top portion of a file and checking if it contains the headers text, not considering special characters (spaces, tabs, ...).
We highly recommend to keep this option set to true.
  • Type: boolean
  • Required: No
  • User Property: license.strictCheck
  • Default: true

<useDefaultMapping>

Whether to use the default mapping between file extensions and comment types, or only the one your provide.
  • Type: boolean
  • Required: No
  • User Property: license.useDefaultMapping
  • Default: true