org.apache.maven.plugin.descriptor
Class MojoDescriptor

java.lang.Object
  extended by org.codehaus.plexus.component.repository.ComponentDescriptor<Mojo>
      extended by org.apache.maven.plugin.descriptor.MojoDescriptor
All Implemented Interfaces:
Cloneable

public class MojoDescriptor
extends org.codehaus.plexus.component.repository.ComponentDescriptor<Mojo>
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


Field Summary
static String MAVEN_PLUGIN
          The Plexus component type
static String MULTI_PASS_EXEC_STRATEGY
          "always" execution strategy
static String SINGLE_PASS_EXEC_STRATEGY
          "once-per-session" execution strategy
 
Constructor Summary
MojoDescriptor()
          Default constructor.
 
Method Summary
 void addParameter(Parameter parameter)
           
 boolean alwaysExecute()
           
 MojoDescriptor clone()
          Creates a shallow copy of this mojo descriptor.
 boolean equals(Object object)
          
 String getComponentType()
          
 String getDependencyCollectionRequired()
          Gets the scope of (transitive) dependencies that should be collected.
 String getDependencyResolutionRequired()
           
 String getDeprecated()
           
 String getExecuteGoal()
           
 String getExecuteLifecycle()
           
 String getExecutePhase()
           
 String getExecutionStrategy()
           
 String getFullGoalName()
           
 String getGoal()
           
 String getId()
           
 String getLanguage()
           
 org.codehaus.plexus.configuration.PlexusConfiguration getMojoConfiguration()
           
 Map<String,Parameter> getParameterMap()
           
 List<Parameter> getParameters()
           
 String getPhase()
           
 PluginDescriptor getPluginDescriptor()
           
 String getRole()
          
 String getRoleHint()
          
 String getSince()
           
 int hashCode()
          
 boolean isAggregator()
           
 String isDependencyResolutionRequired()
          Deprecated. 
 boolean isDirectInvocationOnly()
           
 boolean isForking()
           
 boolean isInheritedByDefault()
           
 boolean isOnlineRequired()
           
 boolean isProjectRequired()
           
 boolean isRequiresReports()
           
 boolean isThreadSafe()
           
 boolean requiresOnline()
           
 void setAggregator(boolean aggregator)
           
 void setDependencyCollectionRequired(String requiresDependencyCollection)
           
 void setDependencyResolutionRequired(String requiresDependencyResolution)
           
 void setDeprecated(String deprecated)
           
 void setDirectInvocationOnly(boolean directInvocationOnly)
           
 void setExecuteGoal(String executeGoal)
           
 void setExecuteLifecycle(String executeLifecycle)
           
 void setExecutePhase(String executePhase)
           
 void setExecutionStrategy(String executionStrategy)
           
 void setGoal(String goal)
           
 void setInheritedByDefault(boolean inheritedByDefault)
           
 void setLanguage(String language)
           
 void setMojoConfiguration(org.codehaus.plexus.configuration.PlexusConfiguration mojoConfiguration)
           
 void setOnlineRequired(boolean requiresOnline)
           
 void setParameters(List<Parameter> parameters)
           
 void setPhase(String phase)
           
 void setPluginDescriptor(PluginDescriptor pluginDescriptor)
           
 void setProjectRequired(boolean requiresProject)
           
 void setRequiresReports(boolean requiresReports)
           
 void setSince(String since)
           
 void setThreadSafe(boolean threadSafe)
           
 
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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAVEN_PLUGIN

public static final String MAVEN_PLUGIN
The Plexus component type

See Also:
Constant Field Values

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
Constructor Detail

MojoDescriptor

public MojoDescriptor()
Default constructor.

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:
true if the Mojo is deprecated, false otherwise.

setDeprecated

public void setDeprecated(String deprecated)
Parameters:
deprecated - true to deprecate the Mojo, false otherwise.

getParameters

public List<Parameter> getParameters()
Returns:
the list of parameters

setParameters

public void setParameters(List<Parameter> 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<String,Parameter> getParameterMap()
Returns:
the list parameters as a Map

setDependencyResolutionRequired

public void setDependencyResolutionRequired(String requiresDependencyResolution)
Parameters:
requiresDependencyResolution - the new required dependencies in a specified scope

getDependencyResolutionRequired

public String getDependencyResolutionRequired()

isDependencyResolutionRequired

@Deprecated
public String isDependencyResolutionRequired()
Deprecated. 

Returns:
the required dependencies in a specified scope

setDependencyCollectionRequired

public void setDependencyCollectionRequired(String requiresDependencyCollection)

getDependencyCollectionRequired

public String getDependencyCollectionRequired()
Gets the scope of (transitive) dependencies that should be collected. Dependency collection refers to the process of calculating the complete dependency tree in terms of artifact coordinates. In contrast to dependency resolution, this does not include the download of the files for the dependency artifacts.

Returns:
The scope of (transitive) dependencies that should be collected or null if none.

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 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:
true if the Mojo uses always for the executionStrategy

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:
getRole in class org.codehaus.plexus.component.repository.ComponentDescriptor<Mojo>

getRoleHint

public String getRoleHint()

Overrides:
getRoleHint in class org.codehaus.plexus.component.repository.ComponentDescriptor<Mojo>

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:
getComponentType in class org.codehaus.plexus.component.repository.ComponentDescriptor<Mojo>

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(Object object)

Overrides:
equals in class org.codehaus.plexus.component.repository.ComponentDescriptor<Mojo>

hashCode

public int hashCode()

Overrides:
hashCode in class org.codehaus.plexus.component.repository.ComponentDescriptor<Mojo>

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 - 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(String executeGoal)
Parameters:
executeGoal - the new invocation goal of the Mojo

getExecuteGoal

public String getExecuteGoal()
Returns:
the invocation goal of the Mojo

isThreadSafe

public boolean isThreadSafe()
Returns:
True if the Mojo is thread-safe and can be run safely in parallel

setThreadSafe

public void setThreadSafe(boolean threadSafe)
Parameters:
threadSafe - indicates that the mojo is thread-safe and can be run safely in parallel

isForking

public boolean isForking()
Returns:
true if this mojo forks either a goal or the lifecycle, false otherwise.

clone

public MojoDescriptor clone()
Creates a shallow copy of this mojo descriptor.

Overrides:
clone in class Object


Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.