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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create MojoDescriptor instances. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMojoDescriptor(MojoDescriptor.Builder builder) Constructor for this class, to be called from its subclasses andMojoDescriptor.Builder. -
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.booleanFlags this Mojo to run it in a multi-module way, i.e.booleanFlags this Mojo to be invoked directly only.booleanSpecify that the Mojo is inherited.booleanFlags this Mojo to require online mode for its operation.booleanFlags this Mojo to require running inside of a project.static MojoDescriptor.BuilderCreates a newMojoDescriptorbuilder instance.static MojoDescriptor.BuildernewBuilder(boolean withDefaults) Creates a newMojoDescriptorbuilder instance using default values or not.static MojoDescriptor.BuildernewBuilder(MojoDescriptor from) Creates a newMojoDescriptorbuilder instance using the specified object as a basis.static MojoDescriptor.BuildernewBuilder(MojoDescriptor from, boolean forceCopy) Creates a newMojoDescriptorbuilder instance using the specified object as a basis.static MojoDescriptorCreates a newMojoDescriptorinstance.static MojoDescriptornewInstance(boolean withDefaults) Creates a newMojoDescriptorinstance using default values or not.with()Creates a new builder with this object as the basis.withAggregator(boolean aggregator) Creates a newMojoDescriptorinstance using the specified aggregator.withConfigurator(String configurator) Creates a newMojoDescriptorinstance using the specified configurator.withDependencyCollection(String dependencyCollection) Creates a newMojoDescriptorinstance using the specified dependencyCollection.withDependencyResolution(String dependencyResolution) Creates a newMojoDescriptorinstance using the specified dependencyResolution.withDeprecated(String deprecated) Creates a newMojoDescriptorinstance using the specified deprecated.withDescription(String description) Creates a newMojoDescriptorinstance using the specified description.withDirectInvocationOnly(boolean directInvocationOnly) Creates a newMojoDescriptorinstance using the specified directInvocationOnly.withExecuteGoal(String executeGoal) Creates a newMojoDescriptorinstance using the specified executeGoal.withExecuteLifecycle(String executeLifecycle) Creates a newMojoDescriptorinstance using the specified executeLifecycle.withExecutePhase(String executePhase) Creates a newMojoDescriptorinstance using the specified executePhase.withFullGoalName(String fullGoalName) Creates a newMojoDescriptorinstance using the specified fullGoalName.Creates a newMojoDescriptorinstance using the specified goal.Creates a newMojoDescriptorinstance using the specified id.withImplementation(String implementation) Creates a newMojoDescriptorinstance using the specified implementation.withInheritedByDefault(boolean inheritedByDefault) Creates a newMojoDescriptorinstance using the specified inheritedByDefault.withLanguage(String language) Creates a newMojoDescriptorinstance using the specified language.withOnlineRequired(boolean onlineRequired) Creates a newMojoDescriptorinstance using the specified onlineRequired.withParameters(Collection<Parameter> parameters) Creates a newMojoDescriptorinstance using the specified parameters.Creates a newMojoDescriptorinstance using the specified phase.withProjectRequired(boolean projectRequired) Creates a newMojoDescriptorinstance using the specified projectRequired.withResolutions(Collection<Resolution> resolutions) Creates a newMojoDescriptorinstance using the specified resolutions.Creates a newMojoDescriptorinstance using the specified since.
-
Constructor Details
-
MojoDescriptor
Constructor for this class, to be called from its subclasses andMojoDescriptor.Builder.- See Also:
-
-
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@deprecatedThis 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>
-
getResolutions
- Returns:
- a
List<Resolution>
-
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 newMojoDescriptorinstance using the specified goal.- Parameters:
goal- the newStringto use- Returns:
- a
MojoDescriptorwith the specified goal
-
withDescription
Creates a newMojoDescriptorinstance using the specified description.- Parameters:
description- the newStringto use- Returns:
- a
MojoDescriptorwith the specified description
-
withImplementation
Creates a newMojoDescriptorinstance using the specified implementation.- Parameters:
implementation- the newStringto use- Returns:
- a
MojoDescriptorwith the specified implementation
-
withLanguage
Creates a newMojoDescriptorinstance using the specified language.- Parameters:
language- the newStringto use- Returns:
- a
MojoDescriptorwith the specified language
-
withPhase
Creates a newMojoDescriptorinstance using the specified phase.- Parameters:
phase- the newStringto use- Returns:
- a
MojoDescriptorwith the specified phase
-
withExecutePhase
Creates a newMojoDescriptorinstance using the specified executePhase.- Parameters:
executePhase- the newStringto use- Returns:
- a
MojoDescriptorwith the specified executePhase
-
withExecuteGoal
Creates a newMojoDescriptorinstance using the specified executeGoal.- Parameters:
executeGoal- the newStringto use- Returns:
- a
MojoDescriptorwith the specified executeGoal
-
withExecuteLifecycle
Creates a newMojoDescriptorinstance using the specified executeLifecycle.- Parameters:
executeLifecycle- the newStringto use- Returns:
- a
MojoDescriptorwith the specified executeLifecycle
-
withDependencyResolution
Creates a newMojoDescriptorinstance using the specified dependencyResolution.- Parameters:
dependencyResolution- the newStringto use- Returns:
- a
MojoDescriptorwith the specified dependencyResolution
-
withDependencyCollection
Creates a newMojoDescriptorinstance using the specified dependencyCollection.- Parameters:
dependencyCollection- the newStringto use- Returns:
- a
MojoDescriptorwith the specified dependencyCollection
-
withDirectInvocationOnly
Creates a newMojoDescriptorinstance using the specified directInvocationOnly.- Parameters:
directInvocationOnly- the newbooleanto use- Returns:
- a
MojoDescriptorwith the specified directInvocationOnly
-
withProjectRequired
Creates a newMojoDescriptorinstance using the specified projectRequired.- Parameters:
projectRequired- the newbooleanto use- Returns:
- a
MojoDescriptorwith the specified projectRequired
-
withOnlineRequired
Creates a newMojoDescriptorinstance using the specified onlineRequired.- Parameters:
onlineRequired- the newbooleanto use- Returns:
- a
MojoDescriptorwith the specified onlineRequired
-
withAggregator
Creates a newMojoDescriptorinstance using the specified aggregator.- Parameters:
aggregator- the newbooleanto use- Returns:
- a
MojoDescriptorwith the specified aggregator
-
withInheritedByDefault
Creates a newMojoDescriptorinstance using the specified inheritedByDefault.- Parameters:
inheritedByDefault- the newbooleanto use- Returns:
- a
MojoDescriptorwith the specified inheritedByDefault
-
withSince
Creates a newMojoDescriptorinstance using the specified since.- Parameters:
since- the newStringto use- Returns:
- a
MojoDescriptorwith the specified since
-
withDeprecated
Creates a newMojoDescriptorinstance using the specified deprecated.- Parameters:
deprecated- the newStringto use- Returns:
- a
MojoDescriptorwith the specified deprecated
-
withConfigurator
Creates a newMojoDescriptorinstance using the specified configurator.- Parameters:
configurator- the newStringto use- Returns:
- a
MojoDescriptorwith the specified configurator
-
withParameters
Creates a newMojoDescriptorinstance using the specified parameters.- Parameters:
parameters- the newCollection<Parameter>to use- Returns:
- a
MojoDescriptorwith the specified parameters
-
withResolutions
Creates a newMojoDescriptorinstance using the specified resolutions.- Parameters:
resolutions- the newCollection<Resolution>to use- Returns:
- a
MojoDescriptorwith the specified resolutions
-
withId
Creates a newMojoDescriptorinstance using the specified id.- Parameters:
id- the newStringto use- Returns:
- a
MojoDescriptorwith the specified id
-
withFullGoalName
Creates a newMojoDescriptorinstance using the specified fullGoalName.- Parameters:
fullGoalName- the newStringto use- Returns:
- a
MojoDescriptorwith the specified fullGoalName
-
newInstance
Creates a newMojoDescriptorinstance. Equivalent tonewInstance(true).- Returns:
- a new
MojoDescriptor - See Also:
-
newInstance
Creates a newMojoDescriptorinstance 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 newMojoDescriptorbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newMojoDescriptorbuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newMojoDescriptorbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
from- theMojoDescriptorinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newMojoDescriptorbuilder instance using the specified object as a basis.- Parameters:
from- theMojoDescriptorinstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-