Package org.apache.maven.model
Class Plugin
- java.lang.Object
-
- org.apache.maven.model.ConfigurationContainer
-
- org.apache.maven.model.Plugin
-
- All Implemented Interfaces:
Serializable
,Cloneable
,InputLocationTracker
public class Plugin extends ConfigurationContainer implements Serializable, Cloneable
The<plugin>
element contains informations required for a plugin.- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Plugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependency(Dependency dependency)
Method addDependency.void
addExecution(PluginExecution pluginExecution)
Method addExecution.Plugin
clone()
Method clone.static String
constructKey(String groupId, String artifactId)
boolean
equals(Object other)
void
flushExecutionMap()
Reset theexecutionMap
field tonull
String
getArtifactId()
Get the artifact ID of the plugin in the repository.List<Dependency>
getDependencies()
Method getDependencies.List<PluginExecution>
getExecutions()
Method getExecutions.Map<String,PluginExecution>
getExecutionsAsMap()
String
getExtensions()
Get whether to load Maven extensions (such as packaging and type handlers) from this plugin.Object
getGoals()
Get Deprecated.String
getGroupId()
Get the group ID of the plugin in the repository.String
getId()
Gets the identifier of the plugin.String
getKey()
String
getVersion()
Get the version (or valid range of versions) of the plugin to be used.int
hashCode()
boolean
isExtensions()
void
removeDependency(Dependency dependency)
Method removeDependency.void
removeExecution(PluginExecution pluginExecution)
Method removeExecution.void
setArtifactId(String artifactId)
Set the artifact ID of the plugin in the repository.void
setDependencies(List<Dependency> dependencies)
Set additional dependencies that this project needs to introduce to the plugin's classloader.void
setExecutions(List<PluginExecution> executions)
Set multiple specifications of a set of goals to execute during the build lifecycle, each having (possibly) a different configuration.void
setExtensions(boolean extensions)
void
setExtensions(String extensions)
Set whether to load Maven extensions (such as packaging and type handlers) from this plugin.void
setGoals(Object goals)
Set Deprecated.void
setGroupId(String groupId)
Set the group ID of the plugin in the repository.void
setVersion(String version)
Set the version (or valid range of versions) of the plugin to be used.String
toString()
-
Methods inherited from class org.apache.maven.model.ConfigurationContainer
getConfiguration, getInherited, getLocation, isInheritanceApplied, isInherited, setConfiguration, setInherited, setInherited, setLocation, setOtherLocation, unsetInheritanceApplied
-
-
-
-
Method Detail
-
addDependency
public void addDependency(Dependency dependency)
Method addDependency.- Parameters:
dependency
- a dependency object.
-
addExecution
public void addExecution(PluginExecution pluginExecution)
Method addExecution.- Parameters:
pluginExecution
- a pluginExecution object.
-
clone
public Plugin clone()
Method clone.- Overrides:
clone
in classConfigurationContainer
- Returns:
- Plugin
-
getArtifactId
public String getArtifactId()
Get the artifact ID of the plugin in the repository.- Returns:
- String
-
getDependencies
public List<Dependency> getDependencies()
Method getDependencies.- Returns:
- List
-
getExecutions
public List<PluginExecution> getExecutions()
Method getExecutions.- Returns:
- List
-
getExtensions
public String getExtensions()
Get whether to load Maven extensions (such as packaging and type handlers) from this plugin. For performance reasons, this should only be enabled when necessary. Note: While the type of this field isString
for technical reasons, the semantic type is actuallyBoolean
. Default value isfalse
.- Returns:
- String
-
getGoals
public Object getGoals()
Get Deprecated. Unused by Maven.- Returns:
- Object
-
getGroupId
public String getGroupId()
Get the group ID of the plugin in the repository.- Returns:
- String
-
getVersion
public String getVersion()
Get the version (or valid range of versions) of the plugin to be used.- Returns:
- String
-
removeDependency
public void removeDependency(Dependency dependency)
Method removeDependency.- Parameters:
dependency
- a dependency object.
-
removeExecution
public void removeExecution(PluginExecution pluginExecution)
Method removeExecution.- Parameters:
pluginExecution
- a pluginExecution object.
-
setArtifactId
public void setArtifactId(String artifactId)
Set the artifact ID of the plugin in the repository.- Parameters:
artifactId
- a artifactId object.
-
setDependencies
public void setDependencies(List<Dependency> dependencies)
Set additional dependencies that this project needs to introduce to the plugin's classloader.- Parameters:
dependencies
- a dependencies object.
-
setExecutions
public void setExecutions(List<PluginExecution> executions)
Set multiple specifications of a set of goals to execute during the build lifecycle, each having (possibly) a different configuration.- Parameters:
executions
- a executions object.
-
setExtensions
public void setExtensions(String extensions)
Set whether to load Maven extensions (such as packaging and type handlers) from this plugin. For performance reasons, this should only be enabled when necessary. Note: While the type of this field isString
for technical reasons, the semantic type is actuallyBoolean
. Default value isfalse
.- Parameters:
extensions
- a extensions object.
-
setGoals
public void setGoals(Object goals)
Set Deprecated. Unused by Maven.- Parameters:
goals
- a goals object.
-
setGroupId
public void setGroupId(String groupId)
Set the group ID of the plugin in the repository.- Parameters:
groupId
- a groupId object.
-
setVersion
public void setVersion(String version)
Set the version (or valid range of versions) of the plugin to be used.- Parameters:
version
- a version object.
-
isExtensions
public boolean isExtensions()
-
setExtensions
public void setExtensions(boolean extensions)
-
flushExecutionMap
public void flushExecutionMap()
Reset theexecutionMap
field tonull
-
getExecutionsAsMap
public Map<String,PluginExecution> getExecutionsAsMap()
- Returns:
- a Map of executions field with
PluginExecution#getId()
as key - See Also:
PluginExecution.getId()
-
getId
public String getId()
Gets the identifier of the plugin.- Returns:
- The plugin id in the form
<groupId>:<artifactId>:<version>
, nevernull
.
-
getKey
public String getKey()
- Returns:
- the key of the plugin, ie
groupId:artifactId
-
constructKey
public static String constructKey(String groupId, String artifactId)
- Parameters:
groupId
- The group ID of the plugin in the repositoryartifactId
- The artifact ID of the reporting plugin in the repository- Returns:
- the key of the plugin, ie
groupId:artifactId
-
equals
public boolean equals(Object other)
- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
-