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 String
optional copyright owners.protected String
optional copyright string formatprotected static final String[]
protected static final String[]
protected static final String[]
optional extra templates parameters.protected boolean
Ignore the last date for copyright year range.protected Integer
Inception year of the project.protected String
Name of project's organization.protected String
Name of project (or module).Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected License
protected License
getLicense
(String licenseName, boolean checkIfExists) protected String
protected void
init()
Method to initialize the mojo before doing any concrete actions.protected boolean
protected String
processLicenseContext
(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, shouldSkip
Methods 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,
organizationName
parameter 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()
-
-
Method Details
-
init
Method to initialize the mojo before doing any concrete actions. Note: The method is invoked before theAbstractLicenseMojo.doAction()
method.- Specified by:
init
in classAbstractLicenseMojo
- Throws:
Exception
- if any
-
getLicense
-
isKeepBackup
protected boolean isKeepBackup() -
getLicenseName
-
getLicense
-
getCopyrightOwners
-
processLicenseContext
- Throws:
IOException
-