Package org.apache.maven.model
Class Plugin
- java.lang.Object
-
- org.apache.maven.model.ConfigurationContainer
-
- org.apache.maven.model.Plugin
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,InputLocationTracker
public class Plugin extends ConfigurationContainer implements java.io.Serializable, java.lang.Cloneable
The<plugin>element contains informations required for a plugin.- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringartifactIdThe artifact ID of the plugin in the repository.private java.util.List<Dependency>dependenciesField dependencies.private java.util.Map<java.lang.String,PluginExecution>executionMapprivate java.util.List<PluginExecution>executionsField executions.private java.lang.StringextensionsWhether to load Maven extensions (such as packaging and type handlers) from this plugin.private java.lang.ObjectgoalsDeprecated.private java.lang.StringgroupIdThe group ID of the plugin in the repository.private java.lang.Stringkeyprivate java.lang.StringversionThe version (or valid range of versions) of the plugin to be used.
-
Constructor Summary
Constructors Constructor Description Plugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDependency(Dependency dependency)Method addDependency.voidaddExecution(PluginExecution pluginExecution)Method addExecution.Pluginclone()Method clone.static java.lang.StringconstructKey(java.lang.String groupId, java.lang.String artifactId)booleanequals(java.lang.Object other)voidflushExecutionMap()Reset theexecutionMapfield tonulljava.lang.StringgetArtifactId()Get the artifact ID of the plugin in the repository.java.util.List<Dependency>getDependencies()Method getDependencies.java.util.List<PluginExecution>getExecutions()Method getExecutions.java.util.Map<java.lang.String,PluginExecution>getExecutionsAsMap()java.lang.StringgetExtensions()Get whether to load Maven extensions (such as packaging and type handlers) from this plugin.java.lang.ObjectgetGoals()Get Deprecated.java.lang.StringgetGroupId()Get the group ID of the plugin in the repository.java.lang.StringgetId()Gets the identifier of the plugin.java.lang.StringgetKey()java.lang.StringgetVersion()Get the version (or valid range of versions) of the plugin to be used.inthashCode()booleanisExtensions()voidremoveDependency(Dependency dependency)Method removeDependency.voidremoveExecution(PluginExecution pluginExecution)Method removeExecution.voidsetArtifactId(java.lang.String artifactId)Set the artifact ID of the plugin in the repository.voidsetDependencies(java.util.List<Dependency> dependencies)Set additional dependencies that this project needs to introduce to the plugin's classloader.voidsetExecutions(java.util.List<PluginExecution> executions)Set multiple specifications of a set of goals to execute during the build lifecycle, each having (possibly) a different configuration.voidsetExtensions(boolean extensions)voidsetExtensions(java.lang.String extensions)Set whether to load Maven extensions (such as packaging and type handlers) from this plugin.voidsetGoals(java.lang.Object goals)Set Deprecated.voidsetGroupId(java.lang.String groupId)Set the group ID of the plugin in the repository.voidsetVersion(java.lang.String version)Set the version (or valid range of versions) of the plugin to be used.java.lang.StringtoString()-
Methods inherited from class org.apache.maven.model.ConfigurationContainer
getConfiguration, getInherited, getLocation, isInheritanceApplied, isInherited, setConfiguration, setInherited, setInherited, setLocation, setOtherLocation, unsetInheritanceApplied
-
-
-
-
Field Detail
-
groupId
private java.lang.String groupId
The group ID of the plugin in the repository.
-
artifactId
private java.lang.String artifactId
The artifact ID of the plugin in the repository.
-
version
private java.lang.String version
The version (or valid range of versions) of the plugin to be used.
-
extensions
private java.lang.String extensions
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 isStringfor technical reasons, the semantic type is actuallyBoolean. Default value isfalse.
-
executions
private java.util.List<PluginExecution> executions
Field executions.
-
dependencies
private java.util.List<Dependency> dependencies
Field dependencies.
-
goals
private java.lang.Object goals
Deprecated. Unused by Maven.
-
executionMap
private java.util.Map<java.lang.String,PluginExecution> executionMap
-
key
private java.lang.String key
-
-
Method Detail
-
addDependency
public void addDependency(Dependency dependency)
Method addDependency.- Parameters:
dependency-
-
addExecution
public void addExecution(PluginExecution pluginExecution)
Method addExecution.- Parameters:
pluginExecution-
-
clone
public Plugin clone()
Method clone.- Overrides:
clonein classConfigurationContainer- Returns:
- Plugin
-
getArtifactId
public java.lang.String getArtifactId()
Get the artifact ID of the plugin in the repository.- Returns:
- String
-
getDependencies
public java.util.List<Dependency> getDependencies()
Method getDependencies.- Returns:
- List
-
getExecutions
public java.util.List<PluginExecution> getExecutions()
Method getExecutions.- Returns:
- List
-
getExtensions
public java.lang.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 isStringfor technical reasons, the semantic type is actuallyBoolean. Default value isfalse.- Returns:
- String
-
getGoals
public java.lang.Object getGoals()
Get Deprecated. Unused by Maven.- Returns:
- Object
-
getGroupId
public java.lang.String getGroupId()
Get the group ID of the plugin in the repository.- Returns:
- String
-
getVersion
public java.lang.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-
-
removeExecution
public void removeExecution(PluginExecution pluginExecution)
Method removeExecution.- Parameters:
pluginExecution-
-
setArtifactId
public void setArtifactId(java.lang.String artifactId)
Set the artifact ID of the plugin in the repository.- Parameters:
artifactId-
-
setDependencies
public void setDependencies(java.util.List<Dependency> dependencies)
Set additional dependencies that this project needs to introduce to the plugin's classloader.- Parameters:
dependencies-
-
setExecutions
public void setExecutions(java.util.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-
-
setExtensions
public void setExtensions(java.lang.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 isStringfor technical reasons, the semantic type is actuallyBoolean. Default value isfalse.- Parameters:
extensions-
-
setGoals
public void setGoals(java.lang.Object goals)
Set Deprecated. Unused by Maven.- Parameters:
goals-
-
setGroupId
public void setGroupId(java.lang.String groupId)
Set the group ID of the plugin in the repository.- Parameters:
groupId-
-
setVersion
public void setVersion(java.lang.String version)
Set the version (or valid range of versions) of the plugin to be used.- Parameters:
version-
-
isExtensions
public boolean isExtensions()
-
setExtensions
public void setExtensions(boolean extensions)
-
flushExecutionMap
public void flushExecutionMap()
Reset theexecutionMapfield tonull
-
getExecutionsAsMap
public java.util.Map<java.lang.String,PluginExecution> getExecutionsAsMap()
- Returns:
- a Map of executions field with
PluginExecution#getId()as key - See Also:
PluginExecution.getId()
-
getId
public java.lang.String getId()
Gets the identifier of the plugin.- Returns:
- The plugin id in the form
<groupId>:<artifactId>:<version>, nevernull.
-
getKey
public java.lang.String getKey()
- Returns:
- the key of the plugin, ie
groupId:artifactId
-
constructKey
public static java.lang.String constructKey(java.lang.String groupId, java.lang.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(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-