Package org.codehaus.mojo.license
Class UpdateProjectLicenseMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.license.AbstractLicenseMojo
org.codehaus.mojo.license.AbstractLicenseNameMojo
org.codehaus.mojo.license.UpdateProjectLicenseMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="update-project-license",
defaultPhase=GENERATE_RESOURCES)
public class UpdateProjectLicenseMojo
extends AbstractLicenseNameMojo
Updates (or creates) the main project license file according to the given
license defines as
AbstractLicenseNameMojo.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
.- Since:
- 1.0
- Author:
- tchemit dev@tchemit.fr
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The path of the bundled license file to produce whengenerateBundle
is on.protected boolean
A flag to force to generate project license file even if it is up-to-date.protected boolean
A flag to copy the main license file in a bundled place.protected File
Project license file to synchronize with main license defined in descriptor file.protected File
The directory where to generate license resources.protected boolean
A flag to skip the goal.Fields inherited from class org.codehaus.mojo.license.AbstractLicenseNameMojo
copyrightOwners, copyrightStringFormat, DEFAULT_EXCLUDES, DEFAULT_INCLUDES, DEFAULT_ROOTS, extraTemplateParameters, ignoreLastDate, inceptionYear, organizationName, projectName
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.codehaus.mojo.license.AbstractLicenseNameMojo
getCopyrightOwners, getLicense, getLicense, getLicenseName, isKeepBackup, processLicenseContext
Methods inherited from class org.codehaus.mojo.license.AbstractLicenseMojo
acceptPackaging, addResourceDir, afterExecute, checkEncoding, checkPackaging, execute, getEncoding, getProject, hasClassPath, isVerbose, rejectPackaging, setEncoding, setVerbose, shouldSkip
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
licenseFile
@Parameter(property="license.licenceFile", defaultValue="${basedir}/LICENSE.txt") protected File licenseFileProject license file to synchronize with main license defined in descriptor file.- Since:
- 1.0
-
outputDirectory
@Parameter(property="license.outputDirectory", defaultValue="target/generated-sources/license") protected File outputDirectoryThe directory where to generate license resources. Note: This option is not available forpom
module types.- Since:
- 1.0
-
generateBundle
@Parameter(property="license.generateBundle", defaultValue="false") protected boolean generateBundleA 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 totrue
, will copy the license file to thebundleLicensePath
tooutputDirectory
. Note: This option is not available forpom
module types.- Since:
- 1.0
-
bundleLicensePath
@Parameter(property="license.bundleLicensePath", defaultValue="META-INF/${project.artifactId}-LICENSE.txt") protected String bundleLicensePathThe path of the bundled license file to produce whengenerateBundle
is on. Note: This option is not available forpom
module types.- Since:
- 1.0
-
force
@Parameter(property="license.force", defaultValue="false") protected boolean forceA flag to force to generate project license file even if it is up-to-date.- Since:
- 1.0.0
-
skipUpdateProjectLicense
@Parameter(property="license.skipUpdateProjectLicense", defaultValue="false") protected boolean skipUpdateProjectLicenseA flag to skip the goal.- Since:
- 1.0
-
-
Constructor Details
-
UpdateProjectLicenseMojo
public UpdateProjectLicenseMojo()
-
-
Method Details
-
isSkip
public boolean isSkip()When is sets totrue
, will skip execution. This will take effect in at the very begin of theAbstractLicenseMojo.execute()
before any initialisation of goal.- Specified by:
isSkip
in classAbstractLicenseMojo
- Returns:
true
if goal will not be executed
-
init
Method to initialize the mojo before doing any concrete actions. Note: The method is invoked before theAbstractLicenseMojo.doAction()
method.- Overrides:
init
in classAbstractLicenseNameMojo
- Throws:
Exception
- if any
-
doAction
Do plugin action. The methodAbstractLicenseMojo.execute()
invoke this method only and only if :AbstractLicenseMojo.checkPackaging()
returnstrue
.- method
AbstractLicenseMojo.init()
returnstrue
.
- Specified by:
doAction
in classAbstractLicenseMojo
- Throws:
Exception
- if any
-