Class MojoDescriptor
java.lang.Object
org.apache.maven.api.plugin.descriptor.MojoDescriptor
- All Implemented Interfaces:
Serializable
@Experimental
@Generated
@ThreadSafe
@Immutable
public class MojoDescriptor
extends Object
implements Serializable
A Mojo description.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create MojoDescriptor instances. -
Method Summary
Modifier and TypeMethodDescriptionThe configurator type to use when injecting parameter values into this Mojo.Flags this Mojo as requiring information about the dependencies that would make up the specified class path.Flags this Mojo as requiring the dependencies in the specified class path to be resolved before it can execute:compile
,runtime
,test
,compile+runtime
(since Maven 3.0) orruntime+system
(since Maven 3.0)Description with the reason of Mojo deprecation.The description of this Mojo's functionality.Reference the invocation goal of the Mojo.Reference the invocation phase of the Mojo.the full goal namegetGoal()
The goal name for the Mojo, that users will reference from the command line to execute the Mojo directly, or inside a POM in order to provide Mojo-specific configuration.getId()
the id of the mojo, based on the goal nameThe Mojo's fully-qualified class name (or script path in the case of non-Java Mojos).The implementation language for this Mojo (java, beanshell, etc.).getPhase()
Defines a default phase to bind a Mojo execution to if the user does not explicitly set a phase in the POM.getSince()
Specify the version when the Mojo was added to the API.boolean
Flags this Mojo to run it in a multi-module way, i.e.boolean
Flags this Mojo to be invoked directly only.boolean
Specify that the Mojo is inherited.boolean
Flags this Mojo to require online mode for its operation.boolean
Flags this Mojo to require running inside of a project.static MojoDescriptor.Builder
Creates a newMojoDescriptor
builder instance.static MojoDescriptor.Builder
newBuilder
(boolean withDefaults) Creates a newMojoDescriptor
builder instance using default values or not.static MojoDescriptor.Builder
newBuilder
(MojoDescriptor from) Creates a newMojoDescriptor
builder instance using the specified object as a basis.static MojoDescriptor.Builder
newBuilder
(MojoDescriptor from, boolean forceCopy) Creates a newMojoDescriptor
builder instance using the specified object as a basis.static MojoDescriptor
Creates a newMojoDescriptor
instance.static MojoDescriptor
newInstance
(boolean withDefaults) Creates a newMojoDescriptor
instance using default values or not.with()
Creates a new builder with this object as the basis.withAggregator
(boolean aggregator) Creates a newMojoDescriptor
instance using the specified aggregator.withConfigurator
(String configurator) Creates a newMojoDescriptor
instance using the specified configurator.withDependencyCollection
(String dependencyCollection) Creates a newMojoDescriptor
instance using the specified dependencyCollection.withDependencyResolution
(String dependencyResolution) Creates a newMojoDescriptor
instance using the specified dependencyResolution.withDeprecated
(String deprecated) Creates a newMojoDescriptor
instance using the specified deprecated.withDescription
(String description) Creates a newMojoDescriptor
instance using the specified description.withDirectInvocationOnly
(boolean directInvocationOnly) Creates a newMojoDescriptor
instance using the specified directInvocationOnly.withExecuteGoal
(String executeGoal) Creates a newMojoDescriptor
instance using the specified executeGoal.withExecuteLifecycle
(String executeLifecycle) Creates a newMojoDescriptor
instance using the specified executeLifecycle.withExecutePhase
(String executePhase) Creates a newMojoDescriptor
instance using the specified executePhase.withFullGoalName
(String fullGoalName) Creates a newMojoDescriptor
instance using the specified fullGoalName.Creates a newMojoDescriptor
instance using the specified goal.Creates a newMojoDescriptor
instance using the specified id.withImplementation
(String implementation) Creates a newMojoDescriptor
instance using the specified implementation.withInheritedByDefault
(boolean inheritedByDefault) Creates a newMojoDescriptor
instance using the specified inheritedByDefault.withLanguage
(String language) Creates a newMojoDescriptor
instance using the specified language.withOnlineRequired
(boolean onlineRequired) Creates a newMojoDescriptor
instance using the specified onlineRequired.withParameters
(Collection<Parameter> parameters) Creates a newMojoDescriptor
instance using the specified parameters.Creates a newMojoDescriptor
instance using the specified phase.withProjectRequired
(boolean projectRequired) Creates a newMojoDescriptor
instance using the specified projectRequired.Creates a newMojoDescriptor
instance using the specified since.
-
Method Details
-
getGoal
The goal name for the Mojo, that users will reference from the command line to execute the Mojo directly, or inside a POM in order to provide Mojo-specific configuration.- Returns:
- a
String
-
getDescription
The description of this Mojo's functionality.- Returns:
- a
String
-
getImplementation
The Mojo's fully-qualified class name (or script path in the case of non-Java Mojos).- Returns:
- a
String
-
getLanguage
The implementation language for this Mojo (java, beanshell, etc.).- Returns:
- a
String
-
getPhase
Defines a default phase to bind a Mojo execution to if the user does not explicitly set a phase in the POM.Note: This will not automagically make a Mojo run when the plugin declaration is added to the POM. It merely enables the user to omit the
<phase>
element from the surrounding<execution>
element.- Returns:
- a
String
-
getExecutePhase
Reference the invocation phase of the Mojo.- Returns:
- a
String
-
getExecuteGoal
Reference the invocation goal of the Mojo.- Returns:
- a
String
-
getExecuteLifecycle
- Returns:
- a
String
-
getDependencyResolution
Flags this Mojo as requiring the dependencies in the specified class path to be resolved before it can execute:compile
,runtime
,test
,compile+runtime
(since Maven 3.0) orruntime+system
(since Maven 3.0)- Returns:
- a
String
-
getDependencyCollection
Flags this Mojo as requiring information about the dependencies that would make up the specified class path. As the name suggests, this is similar to requiresDependencyResolution and supports the same values. The important difference is this will not resolve the files for the dependencies, i.e. the artifacts associated with a Maven project can lack a file. As such, this annotation is meant for Mojos that only want to analyze the set of transitive dependencies, in particular during early lifecycle phases where full dependency resolution might fail due to projects which haven't been built yet.- Returns:
- a
String
-
isDirectInvocationOnly
public boolean isDirectInvocationOnly()Flags this Mojo to be invoked directly only.- Returns:
- a
boolean
-
isProjectRequired
public boolean isProjectRequired()Flags this Mojo to require running inside of a project.- Returns:
- a
boolean
-
isOnlineRequired
public boolean isOnlineRequired()Flags this Mojo to require online mode for its operation.- Returns:
- a
boolean
-
isAggregator
public boolean isAggregator()Flags this Mojo to run it in a multi-module way, i.e. aggregate the build with the set of projects listed as modules.- Returns:
- a
boolean
-
isInheritedByDefault
public boolean isInheritedByDefault()Specify that the Mojo is inherited.- Returns:
- a
boolean
-
getSince
Specify the version when the Mojo was added to the API. Similar to Javadoc since.- Returns:
- a
String
-
getDeprecated
Description with the reason of Mojo deprecation. Similar to Javadoc@deprecated
This will trigger a warning when a user tries to use a Mojo marked as deprecated.- Returns:
- a
String
-
getConfigurator
The configurator type to use when injecting parameter values into this Mojo. The value is normally deduced from the Mojo's implementation language, but can be specified to allow a custom ComponentConfigurator implementation to be used.- Returns:
- a
String
-
getParameters
- Returns:
- a
List<Parameter>
-
getId
the id of the mojo, based on the goal name- Returns:
- a
String
-
getFullGoalName
the full goal name- Returns:
- a
String
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withGoal
Creates a newMojoDescriptor
instance using the specified goal.- Parameters:
goal
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified goal
-
withDescription
Creates a newMojoDescriptor
instance using the specified description.- Parameters:
description
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified description
-
withImplementation
Creates a newMojoDescriptor
instance using the specified implementation.- Parameters:
implementation
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified implementation
-
withLanguage
Creates a newMojoDescriptor
instance using the specified language.- Parameters:
language
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified language
-
withPhase
Creates a newMojoDescriptor
instance using the specified phase.- Parameters:
phase
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified phase
-
withExecutePhase
Creates a newMojoDescriptor
instance using the specified executePhase.- Parameters:
executePhase
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified executePhase
-
withExecuteGoal
Creates a newMojoDescriptor
instance using the specified executeGoal.- Parameters:
executeGoal
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified executeGoal
-
withExecuteLifecycle
Creates a newMojoDescriptor
instance using the specified executeLifecycle.- Parameters:
executeLifecycle
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified executeLifecycle
-
withDependencyResolution
Creates a newMojoDescriptor
instance using the specified dependencyResolution.- Parameters:
dependencyResolution
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified dependencyResolution
-
withDependencyCollection
Creates a newMojoDescriptor
instance using the specified dependencyCollection.- Parameters:
dependencyCollection
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified dependencyCollection
-
withDirectInvocationOnly
Creates a newMojoDescriptor
instance using the specified directInvocationOnly.- Parameters:
directInvocationOnly
- the newboolean
to use- Returns:
- a
MojoDescriptor
with the specified directInvocationOnly
-
withProjectRequired
Creates a newMojoDescriptor
instance using the specified projectRequired.- Parameters:
projectRequired
- the newboolean
to use- Returns:
- a
MojoDescriptor
with the specified projectRequired
-
withOnlineRequired
Creates a newMojoDescriptor
instance using the specified onlineRequired.- Parameters:
onlineRequired
- the newboolean
to use- Returns:
- a
MojoDescriptor
with the specified onlineRequired
-
withAggregator
Creates a newMojoDescriptor
instance using the specified aggregator.- Parameters:
aggregator
- the newboolean
to use- Returns:
- a
MojoDescriptor
with the specified aggregator
-
withInheritedByDefault
Creates a newMojoDescriptor
instance using the specified inheritedByDefault.- Parameters:
inheritedByDefault
- the newboolean
to use- Returns:
- a
MojoDescriptor
with the specified inheritedByDefault
-
withSince
Creates a newMojoDescriptor
instance using the specified since.- Parameters:
since
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified since
-
withDeprecated
Creates a newMojoDescriptor
instance using the specified deprecated.- Parameters:
deprecated
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified deprecated
-
withConfigurator
Creates a newMojoDescriptor
instance using the specified configurator.- Parameters:
configurator
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified configurator
-
withParameters
Creates a newMojoDescriptor
instance using the specified parameters.- Parameters:
parameters
- the newCollection<Parameter>
to use- Returns:
- a
MojoDescriptor
with the specified parameters
-
withId
Creates a newMojoDescriptor
instance using the specified id.- Parameters:
id
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified id
-
withFullGoalName
Creates a newMojoDescriptor
instance using the specified fullGoalName.- Parameters:
fullGoalName
- the newString
to use- Returns:
- a
MojoDescriptor
with the specified fullGoalName
-
newInstance
Creates a newMojoDescriptor
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
MojoDescriptor
- See Also:
-
newInstance
Creates a newMojoDescriptor
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
MojoDescriptor
-
newBuilder
Creates a newMojoDescriptor
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newMojoDescriptor
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newMojoDescriptor
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theMojoDescriptor
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newMojoDescriptor
builder instance using the specified object as a basis.- Parameters:
from
- theMojoDescriptor
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-