public abstract class AbstractLicenseMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractLicenseMojo.AbstractCallback |
Modifier and Type | Field and Description |
---|---|
boolean |
aggregate
You can set this flag to true if you want to check the headers for all
modules of your project.
|
File |
basedir
The base directory, in which to search for project files.
|
float |
concurrencyFactor
Maven license plugin uses concurrency to check license headers.
|
boolean |
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`
|
String |
encoding
Specify the encoding of your files.
|
String[] |
excludes
Specifies files, which are excluded in the check.
|
boolean |
failIfMissing
You can set this flag to false if you do not want the build to fail when
some headers are missing.
|
boolean |
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. |
String |
header
Location of the header.
|
String[] |
headerDefinitions
Allows the use of external header definitions files.
|
HeaderSection[] |
headerSections
HeadSections define special regions of a header that allow for dynamic
substitution and validation
|
String[] |
includes
Specifies files, which are included in the check.
|
String[] |
keywords
Specify the list of keywords to use to detect a header.
|
Map<String,String> |
mapping
Set mapping between document mapping and a supported type to use.
|
org.apache.maven.project.MavenProject |
project |
Map<String,String> |
properties
You can set here some properties that you want to use when reading the
header file.
|
boolean |
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
|
boolean |
skip
Whether to skip the plugin execution
|
boolean |
skipExistingHeaders
Skip the formatting of files which already contain a detected header
|
boolean |
strictCheck
Set to true if you need a strict check against the headers.
|
boolean |
useDefaultExcludes
Specify if you want to use default exclusions besides the files you have
excluded.
|
boolean |
useDefaultMapping
Whether to use the default mapping between file extensions and comment
types, or only the one your provide
|
String[] |
validHeaders
Specifies additional header files to use when checking for the presence
of a valid header in your sources.
|
Constructor and Description |
---|
AbstractLicenseMojo() |
Modifier and Type | Method and Description |
---|---|
void |
debug(String format,
Object... params) |
void |
execute(Callback callback) |
Credentials |
findCredentials(String serverID)
Retrieves the credentials for the given server or null if none could be
found
|
void |
info(String format,
Object... params) |
void |
warn(String format,
Object... params) |
getLog, getPluginContext, setLog, setPluginContext
@Parameter(property="license.basedir", defaultValue="${basedir}", required=true) public File basedir
@Parameter(property="license.header") public String header
@Parameter public String[] validHeaders
@Parameter public String[] headerDefinitions
@Parameter public HeaderSection[] headerSections
@Parameter public Map<String,String> properties
@Parameter public String[] includes
@Parameter public String[] excludes
@Parameter public String[] keywords
@Parameter(property="license.useDefaultExcludes", defaultValue="true") public boolean useDefaultExcludes
@Parameter(property="license.aggregate", defaultValue="false") public boolean aggregate
@Parameter public Map<String,String> mapping
@Parameter(property="license.useDefaultMapping", defaultValue="true") public boolean useDefaultMapping
@Parameter(property="license.concurrencyFactor", defaultValue="1.5") public float concurrencyFactor
<nThreads> = <number of cores> * concurrencyFactor
@Parameter(property="license.skip", defaultValue="false") public boolean skip
@Parameter(property="license.quiet", defaultValue="false") public boolean quiet
@Parameter(property="license.strictCheck", defaultValue="true") public boolean strictCheck
@Parameter(property="license.encoding", defaultValue="${project.build.sourceEncoding}") public String encoding
@Parameter(property="license.failIfMissing", defaultValue="true") public boolean failIfMissing
@Parameter(property="license.failIfUnknown", defaultValue="false") public boolean failIfUnknown
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.
@Parameter(property="license.dryRun", defaultValue="false") public boolean dryRun
@Parameter(property="license.skipExistingHeaders", defaultValue="false") public boolean skipExistingHeaders
@Component public org.apache.maven.project.MavenProject project
public final void execute(Callback callback) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
public Credentials findCredentials(String serverID)
serverID
- Copyright © 2008–2016 Mycila. All rights reserved.