Package org.codehaus.mojo.license
Class AbstractLicenseNameMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.license.AbstractLicenseMojo
org.codehaus.mojo.license.AbstractLicenseNameMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractFileHeaderMojo,RemoveFileHeaderMojo,UpdateProjectLicenseMojo
Abstract mojo which using a
licenseName and owns a
licenseStore.- Since:
- 1.0
- Author:
- tchemit dev@tchemit.fr
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringoptional copyright owners.protected Stringoptional copyright string formatprotected static final String[]protected static final String[]protected static final String[]optional extra templates parameters.protected booleanIgnore the last date for copyright year range.protected IntegerInception year of the project.protected StringName of project's organization.protected StringName of project (or module).Fields inherited from class org.codehaus.mojo.license.AbstractLicenseMojo
projectHelperFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsConstructorDescriptionAbstractLicenseNameMojo(org.apache.maven.project.MavenProjectHelper projectHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected Licenseprotected LicensegetLicense(String licenseName, boolean checkIfExists) protected Stringprotected voidinit()Method to initialize the mojo before doing any concrete actions.protected booleanprotected StringprocessLicenseContext(String licenseContent) Methods inherited from class org.codehaus.mojo.license.AbstractLicenseMojo
acceptPackaging, addResourceDir, afterExecute, checkEncoding, checkPackaging, doAction, execute, getEncoding, getProject, hasClassPath, isSkip, isVerbose, rejectPackaging, setEncoding, setVerbose, shouldSkipMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
DEFAULT_INCLUDES
-
DEFAULT_EXCLUDES
-
DEFAULT_ROOTS
-
projectName
@Parameter(property="license.projectName", defaultValue="${project.name}", required=true) protected String projectNameName of project (or module).Will be used as description section of new header.
- Since:
- 1.0
-
organizationName
@Parameter(property="license.organizationName", defaultValue="${project.organization.name}", required=true) protected String organizationNameName of project's organization.Will be used as copyright's holder in new header.
- Since:
- 1.0
-
inceptionYear
@Parameter(property="license.inceptionYear", defaultValue="${project.inceptionYear}", required=true) protected Integer inceptionYearInception year of the project.Will be used as first year of copyright section in new header.
- Since:
- 1.0
-
copyrightOwners
optional copyright owners.If not set,
organizationNameparameter will be used instead.- Since:
- 1.6
-
copyrightStringFormat
optional copyright string formatIf not set, "Copyright (C) %1$s %2$s" is used where the copyright dates are substituted for $1 and the copyright holder for $2.
- Since:
- 2.1.0
-
extraTemplateParameters
optional extra templates parameters.If filled, they are available with prefix extra_ to process license content (says the header and license content).
- Since:
- 1.6
-
ignoreLastDate
@Parameter(property="license.ignoreLastDate", defaultValue="false") protected boolean ignoreLastDateIgnore the last date for copyright year range.- Since:
- 2.3.0
-
-
Constructor Details
-
AbstractLicenseNameMojo
public AbstractLicenseNameMojo(org.apache.maven.project.MavenProjectHelper projectHelper)
-
-
Method Details
-
init
Method to initialize the mojo before doing any concrete actions. Note: The method is invoked before theAbstractLicenseMojo.doAction()method.- Specified by:
initin classAbstractLicenseMojo- Throws:
Exception- if any
-
getLicense
-
isKeepBackup
protected boolean isKeepBackup() -
getLicenseName
-
getLicense
-
getCopyrightOwners
-
processLicenseContext
- Throws:
IOException
-