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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create MojoDescriptor instances.
- 
Method SummaryModifier 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.Creates a newMojoDescriptorinstance using the specified since.
- 
Method Details- 
getGoalThe 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
 
- 
getDescriptionThe description of this Mojo's functionality.- Returns:
- a String
 
- 
getImplementationThe Mojo's fully-qualified class name (or script path in the case of non-Java Mojos).- Returns:
- a String
 
- 
getLanguageThe implementation language for this Mojo (java, beanshell, etc.).- Returns:
- a String
 
- 
getPhaseDefines 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
 
- 
getExecutePhaseReference the invocation phase of the Mojo.- Returns:
- a String
 
- 
getExecuteGoalReference the invocation goal of the Mojo.- Returns:
- a String
 
- 
getExecuteLifecycle- Returns:
- a String
 
- 
getDependencyResolutionFlags 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
 
- 
getDependencyCollectionFlags 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
 
- 
isDirectInvocationOnlypublic boolean isDirectInvocationOnly()Flags this Mojo to be invoked directly only.- Returns:
- a boolean
 
- 
isProjectRequiredpublic boolean isProjectRequired()Flags this Mojo to require running inside of a project.- Returns:
- a boolean
 
- 
isOnlineRequiredpublic boolean isOnlineRequired()Flags this Mojo to require online mode for its operation.- Returns:
- a boolean
 
- 
isAggregatorpublic 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
 
- 
isInheritedByDefaultpublic boolean isInheritedByDefault()Specify that the Mojo is inherited.- Returns:
- a boolean
 
- 
getSinceSpecify the version when the Mojo was added to the API. Similar to Javadoc since.- Returns:
- a String
 
- 
getDeprecatedDescription 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
 
- 
getConfiguratorThe 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>
 
- 
getIdthe id of the mojo, based on the goal name- Returns:
- a String
 
- 
getFullGoalNamethe full goal name- Returns:
- a String
 
- 
withCreates a new builder with this object as the basis.- Returns:
- a Builder
 
- 
withGoalCreates a newMojoDescriptorinstance using the specified goal.- Parameters:
- goal- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified goal
 
- 
withDescriptionCreates a newMojoDescriptorinstance using the specified description.- Parameters:
- description- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified description
 
- 
withImplementationCreates a newMojoDescriptorinstance using the specified implementation.- Parameters:
- implementation- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified implementation
 
- 
withLanguageCreates a newMojoDescriptorinstance using the specified language.- Parameters:
- language- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified language
 
- 
withPhaseCreates a newMojoDescriptorinstance using the specified phase.- Parameters:
- phase- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified phase
 
- 
withExecutePhaseCreates a newMojoDescriptorinstance using the specified executePhase.- Parameters:
- executePhase- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified executePhase
 
- 
withExecuteGoalCreates a newMojoDescriptorinstance using the specified executeGoal.- Parameters:
- executeGoal- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified executeGoal
 
- 
withExecuteLifecycleCreates a newMojoDescriptorinstance using the specified executeLifecycle.- Parameters:
- executeLifecycle- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified executeLifecycle
 
- 
withDependencyResolutionCreates a newMojoDescriptorinstance using the specified dependencyResolution.- Parameters:
- dependencyResolution- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified dependencyResolution
 
- 
withDependencyCollectionCreates a newMojoDescriptorinstance using the specified dependencyCollection.- Parameters:
- dependencyCollection- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified dependencyCollection
 
- 
withDirectInvocationOnlyCreates a newMojoDescriptorinstance using the specified directInvocationOnly.- Parameters:
- directInvocationOnly- the new- booleanto use
- Returns:
- a MojoDescriptorwith the specified directInvocationOnly
 
- 
withProjectRequiredCreates a newMojoDescriptorinstance using the specified projectRequired.- Parameters:
- projectRequired- the new- booleanto use
- Returns:
- a MojoDescriptorwith the specified projectRequired
 
- 
withOnlineRequiredCreates a newMojoDescriptorinstance using the specified onlineRequired.- Parameters:
- onlineRequired- the new- booleanto use
- Returns:
- a MojoDescriptorwith the specified onlineRequired
 
- 
withAggregatorCreates a newMojoDescriptorinstance using the specified aggregator.- Parameters:
- aggregator- the new- booleanto use
- Returns:
- a MojoDescriptorwith the specified aggregator
 
- 
withInheritedByDefaultCreates a newMojoDescriptorinstance using the specified inheritedByDefault.- Parameters:
- inheritedByDefault- the new- booleanto use
- Returns:
- a MojoDescriptorwith the specified inheritedByDefault
 
- 
withSinceCreates a newMojoDescriptorinstance using the specified since.- Parameters:
- since- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified since
 
- 
withDeprecatedCreates a newMojoDescriptorinstance using the specified deprecated.- Parameters:
- deprecated- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified deprecated
 
- 
withConfiguratorCreates a newMojoDescriptorinstance using the specified configurator.- Parameters:
- configurator- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified configurator
 
- 
withParametersCreates a newMojoDescriptorinstance using the specified parameters.- Parameters:
- parameters- the new- Collection<Parameter>to use
- Returns:
- a MojoDescriptorwith the specified parameters
 
- 
withIdCreates a newMojoDescriptorinstance using the specified id.- Parameters:
- id- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified id
 
- 
withFullGoalNameCreates a newMojoDescriptorinstance using the specified fullGoalName.- Parameters:
- fullGoalName- the new- Stringto use
- Returns:
- a MojoDescriptorwith the specified fullGoalName
 
- 
newInstanceCreates a newMojoDescriptorinstance. Equivalent tonewInstance(true).- Returns:
- a new MojoDescriptor
- See Also:
 
- 
newInstanceCreates 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
 
- 
newBuilderCreates a newMojoDescriptorbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new Builder
- See Also:
 
- 
newBuilderCreates a newMojoDescriptorbuilder instance using default values or not.- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new Builder
 
- 
newBuilderCreates a newMojoDescriptorbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
- from- the- MojoDescriptorinstance to use as a basis
- Returns:
- a new Builder
 
- 
newBuilderCreates a newMojoDescriptorbuilder instance using the specified object as a basis.- Parameters:
- from- the- MojoDescriptorinstance to use as a basis
- forceCopy- the boolean indicating if a copy should be forced
- Returns:
- a new Builder
 
 
-