public abstract class AbstractLicenseMojo
extends org.apache.maven.plugin.AbstractMojo
| Constructor and Description |
|---|
AbstractLicenseMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
acceptPackaging(String... packages)
Accept the project's packaging between some given.
|
protected void |
addResourceDir(File dir,
String... includes)
Add a new resource location to the maven project
(in not already present).
|
protected void |
afterExecute()
A call back to execute after the
execute() is done. |
protected void |
checkEncoding()
Method to be invoked in init phase to check sanity of
getEncoding(). |
protected boolean |
checkPackaging()
Check if the project packaging is acceptable for the mojo.
|
protected boolean |
checkSkip()
Checks if the mojo execution should be skipped.
|
protected abstract void |
doAction()
Do plugin action.
|
void |
execute() |
long |
getBuildTimestamp() |
String |
getEncoding() |
org.apache.maven.project.MavenProject |
getProject() |
org.apache.maven.execution.MavenSession |
getSession() |
protected boolean |
hasClassPath() |
protected abstract void |
init()
Method to initialize the mojo before doing any concrete actions.
|
abstract boolean |
isSkip()
When is sets to
true, will skip execution. |
boolean |
isVerbose() |
protected boolean |
rejectPackaging(String... packages)
Accept the project's packaging if not in given one.
|
void |
setEncoding(String encoding)
Sets new encoding used to read and write files.
|
void |
setVerbose(boolean verbose)
Sets new value to
verbose flag. |
public abstract boolean isSkip()
true, will skip execution.
This will take effect in at the very begin of the execute()
before any initialisation of goal.true if goal will not be executedprotected abstract void init()
throws Exception
doAction() method.Exception - if anyprotected abstract void doAction()
throws Exception
execute() invoke this method only and only if :
checkPackaging() returns true.init() returns true.Exception - if anypublic final void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic final String getEncoding()
public final void setEncoding(String encoding)
encoding - new encodnignt ing to usepublic final org.apache.maven.project.MavenProject getProject()
public final boolean isVerbose()
true if verbose flag is on, false otherwisepublic final void setVerbose(boolean verbose)
verbose flag.verbose - new value to setpublic final org.apache.maven.execution.MavenSession getSession()
MavenSession.public final long getBuildTimestamp()
protected void afterExecute()
execute() is done.protected boolean checkPackaging()
execute().
Tip: There is two method to simplify the packaging check :
acceptPackaging(String...)
and
rejectPackaging(String...)true if can execute the goal for the packaging of the
project, false otherwise.protected boolean checkSkip()
false if the mojo should not be executed.protected boolean acceptPackaging(String... packages)
packages - the accepted packagingtrue if the project's packaging is one of the given ones.protected boolean rejectPackaging(String... packages)
packages - the rejecting packagingstrue if the project's packaging is not in the given ones.protected void checkEncoding()
getEncoding().
If no encoding was filled, then use the default for system
(via file.encoding environement property).protected void addResourceDir(File dir, String... includes)
dir - the new resource location to addincludes - files to includeprotected boolean hasClassPath()
true if project is not a pom, false otherwise.Copyright © 2010–2019 MojoHaus. All rights reserved.