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- Version:
- $Id: MojoDescriptor.java 743587 2009-02-12 01:32:50Z jdcasey $
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAVEN_PLUGINThe Plexus component typestatic StringMULTI_PASS_EXEC_STRATEGY"always" execution strategystatic StringSINGLE_PASS_EXEC_STRATEGY"once-per-session" execution strategy
-
Constructor Summary
Constructors Constructor Description MojoDescriptor()Default constructor.
-
Method Summary
-
Methods inherited from class org.codehaus.plexus.component.repository.ComponentDescriptor
addRequirement, getAlias, getComponentComposer, getComponentConfigurator, getComponentFactory, getComponentProfile, getConfiguration, getDescription, getHumanReadableKey, getImplementation, getImplementationClass, getInstantiationStrategy, getLifecycleHandler, getRealm, getRequirements, getRoleClass, getVersion, hasConfiguration, isIsolatedRealm, setAlias, setComponentComposer, setComponentConfigurator, setComponentFactory, setComponentProfile, setComponentType, setConfiguration, setDescription, setImplementation, setImplementationClass, setInstantiationStrategy, setIsolatedRealm, setLifecycleHandler, setRealm, setRole, setRoleClass, setRoleHint, setVersion, toString
-
-
-
-
Field Detail
-
MAVEN_PLUGIN
public static String MAVEN_PLUGIN
The Plexus component type
-
SINGLE_PASS_EXEC_STRATEGY
public static final String SINGLE_PASS_EXEC_STRATEGY
"once-per-session" execution strategy- See Also:
- Constant Field Values
-
MULTI_PASS_EXEC_STRATEGY
public static final String MULTI_PASS_EXEC_STRATEGY
"always" execution strategy- See Also:
- Constant Field Values
-
-
Method Detail
-
getLanguage
public String getLanguage()
- Returns:
- the language of this Mojo, i.e.
java
-
setLanguage
public void setLanguage(String language)
- Parameters:
language- the new language
-
getDeprecated
public String getDeprecated()
- Returns:
trueif the Mojo is deprecated,falseotherwise.
-
setDeprecated
public void setDeprecated(String deprecated)
- Parameters:
deprecated-trueto deprecate the Mojo,falseotherwise.
-
getParameters
public List getParameters()
- Returns:
- the list of parameters
-
setParameters
public void setParameters(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 Map getParameterMap()
- Returns:
- the list parameters as a Map
-
setDependencyResolutionRequired
public void setDependencyResolutionRequired(String requiresDependencyResolution)
- Parameters:
requiresDependencyResolution- the new required dependencies in a specified scope
-
isDependencyResolutionRequired
public String 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
public String getPhase()
- Returns:
- the binded phase name of the Mojo
-
setPhase
public void setPhase(String phase)
- Parameters:
phase- the new binded phase name of the Mojo
-
getSince
public String getSince()
- Returns:
- the version when the Mojo was added to the API
-
setSince
public void setSince(String since)
- Parameters:
since- the new version when the Mojo was added to the API
-
getGoal
public String getGoal()
- Returns:
- The goal name of the Mojo
-
setGoal
public void setGoal(String goal)
- Parameters:
goal- The new goal name of the Mojo
-
getExecutePhase
public String getExecutePhase()
- Returns:
- the invocation phase of the Mojo
-
setExecutePhase
public void setExecutePhase(String executePhase)
- Parameters:
executePhase- the new invocation phase of the Mojo
-
alwaysExecute
public boolean alwaysExecute()
- Returns:
trueif the Mojo usesalwaysfor theexecutionStrategy
-
getExecutionStrategy
public String getExecutionStrategy()
- Returns:
- the execution strategy
-
setExecutionStrategy
public void setExecutionStrategy(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 String getRole()
- Overrides:
getRolein classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getRoleHint
public String getRoleHint()
- Overrides:
getRoleHintin classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getId
public String getId()
- Returns:
- the id of the mojo, based on the goal name
-
getFullGoalName
public String getFullGoalName()
- Returns:
- the full goal name
- See Also:
PluginDescriptor.getGoalPrefix(),getGoal()
-
getComponentType
public String getComponentType()
- Overrides:
getComponentTypein 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:
trueif the Mojo is herited,falseotherwise.
-
setInheritedByDefault
public void setInheritedByDefault(boolean inheritedByDefault)
- Parameters:
inheritedByDefault-trueif the Mojo is herited,falseotherwise.
-
equals
public boolean equals(Object object)
- Overrides:
equalsin classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
hashCode
public int hashCode()
- Overrides:
hashCodein classorg.codehaus.plexus.component.repository.ComponentDescriptor
-
getExecuteLifecycle
public String getExecuteLifecycle()
- Returns:
- the invocation lifecycle of the Mojo
-
setExecuteLifecycle
public void setExecuteLifecycle(String executeLifecycle)
- 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
public void setExecuteGoal(String executeGoal)
- Parameters:
executeGoal- the new invocation goal of the Mojo
-
getExecuteGoal
public String getExecuteGoal()
- Returns:
- the invocation goal of the Mojo
-
-