Class MojoDescriptor
java.lang.Object
org.codehaus.plexus.component.repository.ComponentDescriptor
org.apache.maven.plugin.descriptor.MojoDescriptor
- All Implemented Interfaces:
Cloneable
public class MojoDescriptor
extends org.codehaus.plexus.component.repository.ComponentDescriptor
implements Cloneable
The bean containing the Mojo descriptor.
For more information about the usage tag, have a look to: http://maven.apache.org/developers/mojo-api-specification.html
For more information about the usage tag, have a look to: http://maven.apache.org/developers/mojo-api-specification.html
- Version:
- $Id: MojoDescriptor.java 743587 2009-02-12 01:32:50Z jdcasey $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanBy default, no need to aggregate the Maven project and its child modulesprivate static final Stringprivate static final Stringprivate StringSpecify the required dependencies in a specified scopeprivate StringSpecify the version when the Mojo was deprecated to the API.private booleanBy default, the Mojo could not be invoke directlyprivate StringReference the invocation goal of the Mojoprivate StringReference the invocation lifecycle of the Mojoprivate StringReference the invocation phase of the Mojoprivate StringBy default, the execution strategy is "once-per-session"private StringThe goal name of the Mojoprivate booleanBy default, the Mojo is heritedstatic StringThe Plexus component typeprivate org.codehaus.plexus.configuration.PlexusConfigurationPlugin configurationstatic final String"always" execution strategyprivate booleanBy default, the Mojo is onlineprivate Mapprivate Listprivate StringReference the binded phase name of the Mojoprivate PluginDescriptorPlugin descriptorprivate booleanBy default, the Mojo needs a Maven project to be executedprivate booleanBy default, the Mojo don't need reports to runprivate StringSpecify the version when the Mojo was added to the API.static final String"once-per-session" execution strategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(Parameter parameter) booleanprivate booleancompareObjects(Object first, Object second) booleangetGoal()getId()org.codehaus.plexus.configuration.PlexusConfigurationgetPhase()getRole()getSince()inthashCode()booleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetAggregator(boolean aggregator) voidsetDependencyResolutionRequired(String requiresDependencyResolution) voidsetDeprecated(String deprecated) voidsetDirectInvocationOnly(boolean directInvocationOnly) voidsetExecuteGoal(String executeGoal) voidsetExecuteLifecycle(String executeLifecycle) voidsetExecutePhase(String executePhase) voidsetExecutionStrategy(String executionStrategy) voidvoidsetInheritedByDefault(boolean inheritedByDefault) voidsetLanguage(String language) voidsetMojoConfiguration(org.codehaus.plexus.configuration.PlexusConfiguration mojoConfiguration) voidsetOnlineRequired(boolean requiresOnline) voidsetParameters(List parameters) voidvoidsetPluginDescriptor(PluginDescriptor pluginDescriptor) voidsetProjectRequired(boolean requiresProject) voidsetRequiresReports(boolean requiresReports) voidMethods inherited from class org.codehaus.plexus.component.repository.ComponentDescriptor
addRequirement, addRequirement, addRequirements, getAlias, getComponentComposer, getComponentConfigurator, getComponentFactory, getComponentProfile, getComponentSetDescriptor, getConfiguration, getDescription, getHumanReadableKey, getImplementation, getImplementationClass, getInstantiationStrategy, getLifecycleHandler, getRealm, getRequirements, getRoleClass, getSource, getVersion, hasConfiguration, isIsolatedRealm, removeRequirement, removeRequirements, setAlias, setComponentComposer, setComponentConfigurator, setComponentFactory, setComponentProfile, setComponentSetDescriptor, setComponentType, setConfiguration, setDescription, setImplementation, setImplementationClass, setInstantiationStrategy, setIsolatedRealm, setLifecycleHandler, setRealm, setRole, setRoleClass, setRoleHint, setSource, setVersion, toString
-
Field Details
-
MAVEN_PLUGIN
The Plexus component type -
SINGLE_PASS_EXEC_STRATEGY
"once-per-session" execution strategy- See Also:
-
MULTI_PASS_EXEC_STRATEGY
"always" execution strategy- See Also:
-
DEFAULT_INSTANTIATION_STRATEGY
- See Also:
-
DEFAULT_LANGUAGE
- See Also:
-
parameters
-
parameterMap
-
executionStrategy
By default, the execution strategy is "once-per-session" -
goal
The goal name of the Mojo -
phase
Reference the binded phase name of the Mojo -
since
Specify the version when the Mojo was added to the API. Similar to Javadoc since. -
executePhase
Reference the invocation phase of the Mojo -
executeGoal
Reference the invocation goal of the Mojo -
executeLifecycle
Reference the invocation lifecycle of the Mojo -
deprecated
Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated. -
aggregator
private boolean aggregatorBy default, no need to aggregate the Maven project and its child modules -
dependencyResolutionRequired
Specify the required dependencies in a specified scope -
projectRequired
private boolean projectRequiredBy default, the Mojo needs a Maven project to be executed -
onlineRequired
private boolean onlineRequiredBy default, the Mojo is online -
mojoConfiguration
private org.codehaus.plexus.configuration.PlexusConfiguration mojoConfigurationPlugin configuration -
pluginDescriptor
Plugin descriptor -
inheritedByDefault
private boolean inheritedByDefaultBy default, the Mojo is herited -
directInvocationOnly
private boolean directInvocationOnlyBy default, the Mojo could not be invoke directly -
requiresReports
private boolean requiresReportsBy default, the Mojo don't need reports to run
-
-
Constructor Details
-
MojoDescriptor
public MojoDescriptor()Default constructor.
-
-
Method Details
-
getLanguage
- Returns:
- the language of this Mojo, i.e.
java
-
setLanguage
- Parameters:
language- the new language
-
getDeprecated
- Returns:
trueif the Mojo is deprecated,falseotherwise.
-
setDeprecated
- Parameters:
deprecated-trueto deprecate the Mojo,falseotherwise.
-
getParameters
- Returns:
- the list of parameters
-
setParameters
- Parameters:
parameters- the new list of parameters- Throws:
DuplicateParameterException- if any
-
addParameter
- Parameters:
parameter- add a new parameter- Throws:
DuplicateParameterException- if any
-
getParameterMap
- Returns:
- the list parameters as a Map
-
setDependencyResolutionRequired
- Parameters:
requiresDependencyResolution- the new required dependencies in a specified scope
-
isDependencyResolutionRequired
- Returns:
- the required dependencies in a specified scope
-
setProjectRequired
public void setProjectRequired(boolean requiresProject) - Parameters:
requiresProject-trueif the Mojo needs a Maven project to be executed,falseotherwise.
-
isProjectRequired
public boolean isProjectRequired()- Returns:
trueif the Mojo needs a Maven project to be executed,falseotherwise.
-
setOnlineRequired
public void setOnlineRequired(boolean requiresOnline) - Parameters:
requiresOnline-trueif the Mojo is online,falseotherwise.
-
isOnlineRequired
public boolean isOnlineRequired()- Returns:
trueif the Mojo is online,falseotherwise.
-
requiresOnline
public boolean requiresOnline()- Returns:
trueif the Mojo is online,falseotherwise.
-
getPhase
- Returns:
- the binded phase name of the Mojo
-
setPhase
- Parameters:
phase- the new binded phase name of the Mojo
-
getSince
- Returns:
- the version when the Mojo was added to the API
-
setSince
- Parameters:
since- the new version when the Mojo was added to the API
-
getGoal
- Returns:
- The goal name of the Mojo
-
setGoal
- Parameters:
goal- The new goal name of the Mojo
-
getExecutePhase
- Returns:
- the invocation phase of the Mojo
-
setExecutePhase
- Parameters:
executePhase- the new invocation phase of the Mojo
-
alwaysExecute
public boolean alwaysExecute()- Returns:
trueif the Mojo usesalwaysfor theexecutionStrategy
-
getExecutionStrategy
- Returns:
- the execution strategy
-
setExecutionStrategy
- Parameters:
executionStrategy- the new execution strategy
-
getMojoConfiguration
public org.codehaus.plexus.configuration.PlexusConfiguration getMojoConfiguration()- Returns:
- the mojo configuration
-
setMojoConfiguration
public void setMojoConfiguration(org.codehaus.plexus.configuration.PlexusConfiguration mojoConfiguration) - Parameters:
mojoConfiguration- a new mojo configuration
-
getRole
- Overrides:
getRolein classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getRoleHint
- Overrides:
getRoleHintin classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getId
- Returns:
- the id of the mojo, based on the goal name
-
getFullGoalName
- Returns:
- the full goal name
- See Also:
-
getComponentType
- Overrides:
getComponentTypein classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getPluginDescriptor
- Returns:
- the plugin descriptor
-
setPluginDescriptor
- Parameters:
pluginDescriptor- the new plugin descriptor
-
isInheritedByDefault
public boolean isInheritedByDefault()- Returns:
trueif the Mojo is herited,falseotherwise.
-
setInheritedByDefault
public void setInheritedByDefault(boolean inheritedByDefault) - Parameters:
inheritedByDefault-trueif the Mojo is herited,falseotherwise.
-
equals
- Overrides:
equalsin classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
compareObjects
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getExecuteLifecycle
- Returns:
- the invocation lifecycle of the Mojo
-
setExecuteLifecycle
- Parameters:
executeLifecycle- the new invocation lifecycle of the Mojo
-
setAggregator
public void setAggregator(boolean aggregator) - Parameters:
aggregator-trueif the Mojo uses the Maven project and its child modules,falseotherwise.
-
isAggregator
public boolean isAggregator()- Returns:
trueif the Mojo uses the Maven project and its child modules,falseotherwise.
-
isDirectInvocationOnly
public boolean isDirectInvocationOnly()- Returns:
trueif the Mojo could not be invoke directly,falseotherwise.
-
setDirectInvocationOnly
public void setDirectInvocationOnly(boolean directInvocationOnly) - Parameters:
directInvocationOnly-trueif the Mojo could not be invoke directly,falseotherwise.
-
isRequiresReports
public boolean isRequiresReports()- Returns:
trueif the Mojo needs reports to run,falseotherwise.
-
setRequiresReports
public void setRequiresReports(boolean requiresReports) - Parameters:
requiresReports-trueif the Mojo needs reports to run,falseotherwise.
-
setExecuteGoal
- Parameters:
executeGoal- the new invocation goal of the Mojo
-
getExecuteGoal
- Returns:
- the invocation goal of the Mojo
-