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 information required for a plugin.- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Plugin instances.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedPlugin(Plugin.Builder builder) Constructor for this class, to be called from its subclasses andPlugin.Builder.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringconstructKey(String groupId, String artifactId) booleanThe 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()getLocation(Object key) Gets the location of the specified field in the input source.Gets the keys of the locations of the input source.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.ConfigurationContainergetConfiguration, getImportedFrom, getInherited, isInherited, newBuilder, newBuilderMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.maven.api.model.InputLocationTrackergetImportedFrom
- 
Constructor Details- 
PluginConstructor for this class, to be called from its subclasses andPlugin.Builder.- See Also:
 
 
- 
- 
Method Details- 
getGroupIdThe group ID of the plugin in the repository.- Returns:
- a String
 
- 
getArtifactIdThe artifact ID of the plugin in the repository.- Returns:
- a String
 
- 
getVersionThe version (or valid range of versions) of the plugin to be used.- Returns:
- a String
 
- 
getExtensionsWhether 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
 
- 
getExecutionsMultiple specifications of a set of goals to execute during the build lifecycle, each having (possibly) a different configuration.- Returns:
- a List<PluginExecution>
 
- 
getDependenciesAdditional dependencies that this project needs to introduce to the plugin's classloader.- Returns:
- a List<Dependency>
 
- 
getLocationGets the location of the specified field in the input source.- Specified by:
- getLocationin interface- InputLocationTracker
- Overrides:
- getLocationin class- ConfigurationContainer
 
- 
getLocationKeysGets the keys of the locations of the input source.- Overrides:
- getLocationKeysin class- ConfigurationContainer
 
- 
withCreates a new builder with this object as the basis.- Overrides:
- within class- ConfigurationContainer
- Returns:
- a Builder
 
- 
withInheritedCreates a newPlugininstance using the specified inherited.- Overrides:
- withInheritedin class- ConfigurationContainer
- Parameters:
- inherited- the new- Stringto use
- Returns:
- a Pluginwith the specified inherited
 
- 
withConfigurationCreates a newPlugininstance using the specified configuration.- Overrides:
- withConfigurationin class- ConfigurationContainer
- Parameters:
- configuration- the new- XmlNodeto use
- Returns:
- a Pluginwith the specified configuration
 
- 
withGroupIdCreates a newPlugininstance using the specified groupId.- Parameters:
- groupId- the new- Stringto use
- Returns:
- a Pluginwith the specified groupId
 
- 
withArtifactIdCreates a newPlugininstance using the specified artifactId.- Parameters:
- artifactId- the new- Stringto use
- Returns:
- a Pluginwith the specified artifactId
 
- 
withVersionCreates a newPlugininstance using the specified version.- Parameters:
- version- the new- Stringto use
- Returns:
- a Pluginwith the specified version
 
- 
withExtensionsCreates a newPlugininstance using the specified extensions.- Parameters:
- extensions- the new- Stringto use
- Returns:
- a Pluginwith the specified extensions
 
- 
withExecutionsCreates a newPlugininstance using the specified executions.- Parameters:
- executions- the new- Collection<PluginExecution>to use
- Returns:
- a Pluginwith the specified executions
 
- 
withDependenciesCreates a newPlugininstance using the specified dependencies.- Parameters:
- dependencies- the new- Collection<Dependency>to use
- Returns:
- a Pluginwith the specified dependencies
 
- 
newInstanceCreates a newPlugininstance. Equivalent tonewInstance(true).- Returns:
- a new Plugin
- See Also:
 
- 
newInstanceCreates 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
 
- 
newBuilderCreates a newPluginbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new Builder
- See Also:
 
- 
newBuilderCreates a newPluginbuilder instance using default values or not.- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new Builder
 
- 
newBuilderCreates a newPluginbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
- from- the- Plugininstance to use as a basis
- Returns:
- a new Builder
 
- 
newBuilderCreates a newPluginbuilder instance using the specified object as a basis.- Parameters:
- from- the- Plugininstance to use as a basis
- forceCopy- the boolean indicating if a copy should be forced
- Returns:
- a new Builder
 
- 
isExtensionspublic boolean isExtensions()
- 
getIdGets 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 repository
- artifactId- the artifact ID of the reporting plugin in the repository
- Returns:
- the key of the plugin, ie groupId:artifactId
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-