Class MojoDescriptor
- java.lang.Object
-
- org.codehaus.plexus.component.repository.ComponentDescriptor
-
- org.apache.maven.plugin.descriptor.MojoDescriptor
-
- All Implemented Interfaces:
java.lang.Cloneable
public class MojoDescriptor extends org.codehaus.plexus.component.repository.ComponentDescriptor implements java.lang.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- Version:
- $Id: MojoDescriptor.java 743587 2009-02-12 01:32:50Z jdcasey $
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
aggregator
By default, no need to aggregate the Maven project and its child modulesprivate static java.lang.String
DEFAULT_INSTANTIATION_STRATEGY
private static java.lang.String
DEFAULT_LANGUAGE
private java.lang.String
dependencyResolutionRequired
Specify the required dependencies in a specified scopeprivate java.lang.String
deprecated
Specify the version when the Mojo was deprecated to the API.private boolean
directInvocationOnly
By default, the Mojo could not be invoke directlyprivate java.lang.String
executeGoal
Reference the invocation goal of the Mojoprivate java.lang.String
executeLifecycle
Reference the invocation lifecycle of the Mojoprivate java.lang.String
executePhase
Reference the invocation phase of the Mojoprivate java.lang.String
executionStrategy
By default, the execution strategy is "once-per-session"private java.lang.String
goal
The goal name of the Mojoprivate boolean
inheritedByDefault
By default, the Mojo is heritedstatic java.lang.String
MAVEN_PLUGIN
The Plexus component typeprivate org.codehaus.plexus.configuration.PlexusConfiguration
mojoConfiguration
Plugin configurationstatic java.lang.String
MULTI_PASS_EXEC_STRATEGY
"always" execution strategyprivate boolean
onlineRequired
By default, the Mojo is onlineprivate java.util.Map
parameterMap
private java.util.List
parameters
private java.lang.String
phase
Reference the binded phase name of the Mojoprivate PluginDescriptor
pluginDescriptor
Plugin descriptorprivate boolean
projectRequired
By default, the Mojo needs a Maven project to be executedprivate boolean
requiresReports
By default, the Mojo don't need reports to runprivate java.lang.String
since
Specify the version when the Mojo was added to the API.static java.lang.String
SINGLE_PASS_EXEC_STRATEGY
"once-per-session" execution strategy
-
Constructor Summary
Constructors Constructor Description MojoDescriptor()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameter(Parameter parameter)
boolean
alwaysExecute()
private boolean
compareObjects(java.lang.Object first, java.lang.Object second)
boolean
equals(java.lang.Object object)
java.lang.String
getComponentType()
java.lang.String
getDeprecated()
java.lang.String
getExecuteGoal()
java.lang.String
getExecuteLifecycle()
java.lang.String
getExecutePhase()
java.lang.String
getExecutionStrategy()
java.lang.String
getFullGoalName()
java.lang.String
getGoal()
java.lang.String
getId()
java.lang.String
getLanguage()
org.codehaus.plexus.configuration.PlexusConfiguration
getMojoConfiguration()
java.util.Map
getParameterMap()
java.util.List
getParameters()
java.lang.String
getPhase()
PluginDescriptor
getPluginDescriptor()
java.lang.String
getRole()
java.lang.String
getRoleHint()
java.lang.String
getSince()
int
hashCode()
boolean
isAggregator()
java.lang.String
isDependencyResolutionRequired()
boolean
isDirectInvocationOnly()
boolean
isInheritedByDefault()
boolean
isOnlineRequired()
boolean
isProjectRequired()
boolean
isRequiresReports()
boolean
requiresOnline()
void
setAggregator(boolean aggregator)
void
setDependencyResolutionRequired(java.lang.String requiresDependencyResolution)
void
setDeprecated(java.lang.String deprecated)
void
setDirectInvocationOnly(boolean directInvocationOnly)
void
setExecuteGoal(java.lang.String executeGoal)
void
setExecuteLifecycle(java.lang.String executeLifecycle)
void
setExecutePhase(java.lang.String executePhase)
void
setExecutionStrategy(java.lang.String executionStrategy)
void
setGoal(java.lang.String goal)
void
setInheritedByDefault(boolean inheritedByDefault)
void
setLanguage(java.lang.String language)
void
setMojoConfiguration(org.codehaus.plexus.configuration.PlexusConfiguration mojoConfiguration)
void
setOnlineRequired(boolean requiresOnline)
void
setParameters(java.util.List parameters)
void
setPhase(java.lang.String phase)
void
setPluginDescriptor(PluginDescriptor pluginDescriptor)
void
setProjectRequired(boolean requiresProject)
void
setRequiresReports(boolean requiresReports)
void
setSince(java.lang.String since)
-
Methods 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 Detail
-
MAVEN_PLUGIN
public static java.lang.String MAVEN_PLUGIN
The Plexus component type
-
SINGLE_PASS_EXEC_STRATEGY
public static final java.lang.String SINGLE_PASS_EXEC_STRATEGY
"once-per-session" execution strategy- See Also:
- Constant Field Values
-
MULTI_PASS_EXEC_STRATEGY
public static final java.lang.String MULTI_PASS_EXEC_STRATEGY
"always" execution strategy- See Also:
- Constant Field Values
-
DEFAULT_INSTANTIATION_STRATEGY
private static final java.lang.String DEFAULT_INSTANTIATION_STRATEGY
- See Also:
- Constant Field Values
-
DEFAULT_LANGUAGE
private static final java.lang.String DEFAULT_LANGUAGE
- See Also:
- Constant Field Values
-
parameters
private java.util.List parameters
-
parameterMap
private java.util.Map parameterMap
-
executionStrategy
private java.lang.String executionStrategy
By default, the execution strategy is "once-per-session"
-
goal
private java.lang.String goal
The goal name of the Mojo
-
phase
private java.lang.String phase
Reference the binded phase name of the Mojo
-
since
private java.lang.String since
Specify the version when the Mojo was added to the API. Similar to Javadoc since.
-
executePhase
private java.lang.String executePhase
Reference the invocation phase of the Mojo
-
executeGoal
private java.lang.String executeGoal
Reference the invocation goal of the Mojo
-
executeLifecycle
private java.lang.String executeLifecycle
Reference the invocation lifecycle of the Mojo
-
deprecated
private java.lang.String deprecated
Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated.
-
aggregator
private boolean aggregator
By default, no need to aggregate the Maven project and its child modules
-
dependencyResolutionRequired
private java.lang.String dependencyResolutionRequired
Specify the required dependencies in a specified scope
-
projectRequired
private boolean projectRequired
By default, the Mojo needs a Maven project to be executed
-
onlineRequired
private boolean onlineRequired
By default, the Mojo is online
-
mojoConfiguration
private org.codehaus.plexus.configuration.PlexusConfiguration mojoConfiguration
Plugin configuration
-
pluginDescriptor
private PluginDescriptor pluginDescriptor
Plugin descriptor
-
inheritedByDefault
private boolean inheritedByDefault
By default, the Mojo is herited
-
directInvocationOnly
private boolean directInvocationOnly
By default, the Mojo could not be invoke directly
-
requiresReports
private boolean requiresReports
By default, the Mojo don't need reports to run
-
-
Method Detail
-
getLanguage
public java.lang.String getLanguage()
- Returns:
- the language of this Mojo, i.e.
java
-
setLanguage
public void setLanguage(java.lang.String language)
- Parameters:
language
- the new language
-
getDeprecated
public java.lang.String getDeprecated()
- Returns:
true
if the Mojo is deprecated,false
otherwise.
-
setDeprecated
public void setDeprecated(java.lang.String deprecated)
- Parameters:
deprecated
-true
to deprecate the Mojo,false
otherwise.
-
getParameters
public java.util.List getParameters()
- Returns:
- the list of parameters
-
setParameters
public void setParameters(java.util.List parameters) throws DuplicateParameterException
- Parameters:
parameters
- the new list of parameters- Throws:
DuplicateParameterException
- if any
-
addParameter
public void addParameter(Parameter parameter) throws DuplicateParameterException
- Parameters:
parameter
- add a new parameter- Throws:
DuplicateParameterException
- if any
-
getParameterMap
public java.util.Map getParameterMap()
- Returns:
- the list parameters as a Map
-
setDependencyResolutionRequired
public void setDependencyResolutionRequired(java.lang.String requiresDependencyResolution)
- Parameters:
requiresDependencyResolution
- the new required dependencies in a specified scope
-
isDependencyResolutionRequired
public java.lang.String isDependencyResolutionRequired()
- Returns:
- the required dependencies in a specified scope
-
setProjectRequired
public void setProjectRequired(boolean requiresProject)
- Parameters:
requiresProject
-true
if the Mojo needs a Maven project to be executed,false
otherwise.
-
isProjectRequired
public boolean isProjectRequired()
- Returns:
true
if the Mojo needs a Maven project to be executed,false
otherwise.
-
setOnlineRequired
public void setOnlineRequired(boolean requiresOnline)
- Parameters:
requiresOnline
-true
if the Mojo is online,false
otherwise.
-
isOnlineRequired
public boolean isOnlineRequired()
- Returns:
true
if the Mojo is online,false
otherwise.
-
requiresOnline
public boolean requiresOnline()
- Returns:
true
if the Mojo is online,false
otherwise.
-
getPhase
public java.lang.String getPhase()
- Returns:
- the binded phase name of the Mojo
-
setPhase
public void setPhase(java.lang.String phase)
- Parameters:
phase
- the new binded phase name of the Mojo
-
getSince
public java.lang.String getSince()
- Returns:
- the version when the Mojo was added to the API
-
setSince
public void setSince(java.lang.String since)
- Parameters:
since
- the new version when the Mojo was added to the API
-
getGoal
public java.lang.String getGoal()
- Returns:
- The goal name of the Mojo
-
setGoal
public void setGoal(java.lang.String goal)
- Parameters:
goal
- The new goal name of the Mojo
-
getExecutePhase
public java.lang.String getExecutePhase()
- Returns:
- the invocation phase of the Mojo
-
setExecutePhase
public void setExecutePhase(java.lang.String executePhase)
- Parameters:
executePhase
- the new invocation phase of the Mojo
-
alwaysExecute
public boolean alwaysExecute()
- Returns:
true
if the Mojo usesalways
for theexecutionStrategy
-
getExecutionStrategy
public java.lang.String getExecutionStrategy()
- Returns:
- the execution strategy
-
setExecutionStrategy
public void setExecutionStrategy(java.lang.String executionStrategy)
- 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
public java.lang.String getRole()
- Overrides:
getRole
in classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getRoleHint
public java.lang.String getRoleHint()
- Overrides:
getRoleHint
in classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getId
public java.lang.String getId()
- Returns:
- the id of the mojo, based on the goal name
-
getFullGoalName
public java.lang.String getFullGoalName()
- Returns:
- the full goal name
- See Also:
PluginDescriptor.getGoalPrefix()
,getGoal()
-
getComponentType
public java.lang.String getComponentType()
- Overrides:
getComponentType
in classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getPluginDescriptor
public PluginDescriptor getPluginDescriptor()
- Returns:
- the plugin descriptor
-
setPluginDescriptor
public void setPluginDescriptor(PluginDescriptor pluginDescriptor)
- Parameters:
pluginDescriptor
- the new plugin descriptor
-
isInheritedByDefault
public boolean isInheritedByDefault()
- Returns:
true
if the Mojo is herited,false
otherwise.
-
setInheritedByDefault
public void setInheritedByDefault(boolean inheritedByDefault)
- Parameters:
inheritedByDefault
-true
if the Mojo is herited,false
otherwise.
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
compareObjects
private boolean compareObjects(java.lang.Object first, java.lang.Object second)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getExecuteLifecycle
public java.lang.String getExecuteLifecycle()
- Returns:
- the invocation lifecycle of the Mojo
-
setExecuteLifecycle
public void setExecuteLifecycle(java.lang.String executeLifecycle)
- Parameters:
executeLifecycle
- the new invocation lifecycle of the Mojo
-
setAggregator
public void setAggregator(boolean aggregator)
- Parameters:
aggregator
-true
if the Mojo uses the Maven project and its child modules,false
otherwise.
-
isAggregator
public boolean isAggregator()
- Returns:
true
if the Mojo uses the Maven project and its child modules,false
otherwise.
-
isDirectInvocationOnly
public boolean isDirectInvocationOnly()
- Returns:
true
if the Mojo could not be invoke directly,false
otherwise.
-
setDirectInvocationOnly
public void setDirectInvocationOnly(boolean directInvocationOnly)
- Parameters:
directInvocationOnly
-true
if the Mojo could not be invoke directly,false
otherwise.
-
isRequiresReports
public boolean isRequiresReports()
- Returns:
true
if the Mojo needs reports to run,false
otherwise.
-
setRequiresReports
public void setRequiresReports(boolean requiresReports)
- Parameters:
requiresReports
-true
if the Mojo needs reports to run,false
otherwise.
-
setExecuteGoal
public void setExecuteGoal(java.lang.String executeGoal)
- Parameters:
executeGoal
- the new invocation goal of the Mojo
-
getExecuteGoal
public java.lang.String getExecuteGoal()
- Returns:
- the invocation goal of the Mojo
-
-