|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.plugin.AbstractMojo org.codehaus.mojo.license.AbstractLicenseMojo
public abstract class AbstractLicenseMojo
Abstract license mojo.
Field Summary |
---|
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
AbstractLicenseMojo()
|
Method Summary | |
---|---|
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. |
boolean |
isVerbose()
|
protected boolean |
rejectPackaging(String... packages)
Accept the project's packaging if not in given one. |
void |
setEncoding(String encoding)
|
void |
setProject(org.apache.maven.project.MavenProject project)
|
void |
setSession(org.apache.maven.execution.MavenSession session)
|
void |
setVerbose(boolean verbose)
|
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
---|
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractLicenseMojo()
Method Detail |
---|
public final String getEncoding()
public final void setEncoding(String encoding)
protected 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.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
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 packaging
true
if the project's packaging is one of the given ones.protected boolean rejectPackaging(String... packages)
packages
- the rejecting packagings
true
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).
public final org.apache.maven.project.MavenProject getProject()
public final void setProject(org.apache.maven.project.MavenProject project)
public final boolean isVerbose()
public final void setVerbose(boolean verbose)
public final org.apache.maven.execution.MavenSession getSession()
public final void setSession(org.apache.maven.execution.MavenSession session)
public final long getBuildTimestamp()
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |