public interface Mojo
Mojos
to interact with the Maven
infrastructure.
execute()
method, which triggers the Mojo's build-process behavior, and can throw
a MojoExecutionException or MojoFailureException if error conditions occur.
setLog(...)
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.Modifier and Type | Field and Description |
---|---|
static String |
ROLE
The component
role hint for Plexus container |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Perform whatever build-process behavior this
Mojo implements. |
Log |
getLog()
Furnish access to the standard Maven logging mechanism which is managed in this base class.
|
void |
setLog(Log log)
Inject a standard
Maven logging mechanism to allow this Mojo to communicate events
and feedback to the user. |
static final String ROLE
role
hint for Plexus containervoid execute() throws MojoExecutionException, MojoFailureException
Mojo
implements.
Mojo
inside the Maven
system, and allows
the Mojo
to communicate errors.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.void setLog(Log log)
Maven
logging mechanism to allow this Mojo
to communicate events
and feedback to the user.log
- a new loggerLog getLog()
"debug"
,
"info"
, "warn"
, and "error"
. This logger is the accepted means to display
information to the user.Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.