Package org.apache.maven.api.model
Class Plugin
java.lang.Object
org.apache.maven.api.model.ConfigurationContainer
org.apache.maven.api.model.Plugin
- All Implemented Interfaces:
Serializable,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Plugin
extends ConfigurationContainer
implements Serializable, InputLocationTracker
The
<plugin> element contains informations required for a plugin.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Plugin instances. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconstructKey(String groupId, String artifactId) booleanvoidReset theexecutionMapfield tonullThe artifact ID of the plugin in the repository.Additional dependencies that this project needs to introduce to the plugin's classloader.Multiple specifications of a set of goals to execute during the build lifecycle, each having (possibly) a different configuration.Whether to load Maven extensions (such as packaging and type handlers) from this plugin.The group ID of the plugin in the repository.getId()Gets the identifier of the plugin.getKey()The version (or valid range of versions) of the plugin to be used.inthashCode()booleanstatic Plugin.BuilderCreates a newPluginbuilder instance.static Plugin.BuildernewBuilder(boolean withDefaults) Creates a newPluginbuilder instance using default values or not.static Plugin.BuildernewBuilder(Plugin from) Creates a newPluginbuilder instance using the specified object as a basis.static Plugin.BuildernewBuilder(Plugin from, boolean forceCopy) Creates a newPluginbuilder instance using the specified object as a basis.static PluginCreates a newPlugininstance.static PluginnewInstance(boolean withDefaults) Creates a newPlugininstance using default values or not.toString()with()Creates a new builder with this object as the basis.withArtifactId(String artifactId) Creates a newPlugininstance using the specified artifactId.withConfiguration(XmlNode configuration) Creates a newPlugininstance using the specified configuration.withDependencies(Collection<Dependency> dependencies) Creates a newPlugininstance using the specified dependencies.withExecutions(Collection<PluginExecution> executions) Creates a newPlugininstance using the specified executions.withExtensions(String extensions) Creates a newPlugininstance using the specified extensions.withGroupId(String groupId) Creates a newPlugininstance using the specified groupId.withInherited(String inherited) Creates a newPlugininstance using the specified inherited.withVersion(String version) Creates a newPlugininstance using the specified version.Methods inherited from class org.apache.maven.api.model.ConfigurationContainer
getConfiguration, getInherited, getLocation, isInherited, newBuilder, newBuilderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.maven.api.model.InputLocationTracker
getLocation
-
Method Details
-
getGroupId
The group ID of the plugin in the repository.- Returns:
- a
String
-
getArtifactId
The artifact ID of the plugin in the repository.- Returns:
- a
String
-
getVersion
The version (or valid range of versions) of the plugin to be used.- Returns:
- a
String
-
getExtensions
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:
- a
String
-
getExecutions
Multiple specifications of a set of goals to execute during the build lifecycle, each having (possibly) a different configuration.- Returns:
- a
List<PluginExecution>
-
getDependencies
Additional dependencies that this project needs to introduce to the plugin's classloader.- Returns:
- a
List<Dependency>
-
with
Creates a new builder with this object as the basis.- Overrides:
within classConfigurationContainer- Returns:
- a
Builder
-
withInherited
Creates a newPlugininstance using the specified inherited.- Overrides:
withInheritedin classConfigurationContainer- Parameters:
inherited- the newStringto use- Returns:
- a
Pluginwith the specified inherited
-
withConfiguration
Creates a newPlugininstance using the specified configuration.- Overrides:
withConfigurationin classConfigurationContainer- Parameters:
configuration- the newXmlNodeto use- Returns:
- a
Pluginwith the specified configuration
-
withGroupId
Creates a newPlugininstance using the specified groupId.- Parameters:
groupId- the newStringto use- Returns:
- a
Pluginwith the specified groupId
-
withArtifactId
Creates a newPlugininstance using the specified artifactId.- Parameters:
artifactId- the newStringto use- Returns:
- a
Pluginwith the specified artifactId
-
withVersion
Creates a newPlugininstance using the specified version.- Parameters:
version- the newStringto use- Returns:
- a
Pluginwith the specified version
-
withExtensions
Creates a newPlugininstance using the specified extensions.- Parameters:
extensions- the newStringto use- Returns:
- a
Pluginwith the specified extensions
-
withExecutions
Creates a newPlugininstance using the specified executions.- Parameters:
executions- the newCollection<PluginExecution>to use- Returns:
- a
Pluginwith the specified executions
-
withDependencies
Creates a newPlugininstance using the specified dependencies.- Parameters:
dependencies- the newCollection<Dependency>to use- Returns:
- a
Pluginwith the specified dependencies
-
newInstance
Creates a newPlugininstance. Equivalent tonewInstance(true).- Returns:
- a new
Plugin - See Also:
-
newInstance
Creates a newPlugininstance using default values or not. Equivalent tonewBuilder(withDefaults).build().- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Plugin
-
newBuilder
Creates a newPluginbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newPluginbuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newPluginbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
from- thePlugininstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newPluginbuilder instance using the specified object as a basis.- Parameters:
from- thePlugininstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
isExtensions
public boolean isExtensions() -
flushExecutionMap
public void flushExecutionMap()Reset theexecutionMapfield tonull -
getExecutionsAsMap
- Returns:
- a Map of executions field with
PluginExecution#getId()as key - See Also:
-
getId
Gets the identifier of the plugin.- Returns:
- the plugin id in the form
<groupId>:<artifactId>:<version>, nevernull
-
getKey
- Returns:
- the key of the plugin, ie
groupId:artifactId
-
constructKey
- 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
-
hashCode
public int hashCode() -
toString
-