Package org.apache.maven.plugin
Interface Mojo
-
- All Known Implementing Classes:
AbstractMojo
public interface MojoThis interface forms the contract required forMojosto interact with theMaveninfrastructure.
It features anexecute()method, which triggers the Mojo's build-process behavior, and can throw a MojoExecutionException or MojoFailureException if error conditions occur.
Also included is thesetLog(...)method, which simply allows Maven to inject a logging mechanism which will allow the Mojo to communicate to the outside world through standard Maven channels.- Author:
- Jason van Zyl
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringROLEThe componentrolehint for Plexus container
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexecute()Perform whatever build-process behavior thisMojoimplements.
This is the main trigger for theMojoinside theMavensystem, and allows theMojoto communicate errors.LoggetLog()Furnish access to the standard Maven logging mechanism which is managed in this base class.voidsetLog(Log log)Inject a standardMavenlogging mechanism to allow thisMojoto communicate events and feedback to the user.
-
-
-
Method Detail
-
execute
void execute() throws MojoExecutionException, MojoFailureExceptionPerform whatever build-process behavior thisMojoimplements.
This is the main trigger for theMojoinside theMavensystem, and allows theMojoto communicate errors.- Throws:
MojoExecutionException- if an unexpected problem occurs. Throwing this exception causes a "BUILD ERROR" message to be displayed.MojoFailureException- if an expected problem (such as a compilation failure) occurs. Throwing this exception causes a "BUILD FAILURE" message to be displayed.
-
setLog
void setLog(Log log)
Inject a standardMavenlogging mechanism to allow thisMojoto communicate events and feedback to the user.- Parameters:
log- a new logger
-
getLog
Log getLog()
Furnish access to the standard Maven logging mechanism which is managed in this base class.- Returns:
- a log4j-like logger object which allows plugins to create messages at levels of
"debug","info","warn", and"error". This logger is the accepted means to display information to the user.
-
-