Class Plugin

  • All Implemented Interfaces:
    java.io.Serializable

    public class Plugin
    extends ConfigurationContainer
    implements java.io.Serializable
    The <plugin> element contains informations required for a plugin.
    Version:
    $Revision$ $Date$
    See Also:
    Serialized Form
    • 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 boolean 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.
      • 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 executionMap
      • key

        private java.lang.String key
    • Constructor Detail

      • Plugin

        public Plugin()
    • 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.
      • 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
      • 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
      • isExtensions

        public boolean isExtensions()
        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.
        Returns:
        boolean
      • 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​(java.lang.String artifactId)
        Set the artifact ID of the plugin in the repository.
        Parameters:
        artifactId - a artifactId object.
      • 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 - a dependencies object.
      • 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 - a executions object.
      • setExtensions

        public void setExtensions​(boolean 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.
        Parameters:
        extensions - a extensions object.
      • setGoals

        public void setGoals​(java.lang.Object goals)
        Set Deprecated. Unused by Maven.
        Parameters:
        goals - a goals object.
      • setGroupId

        public void setGroupId​(java.lang.String groupId)
        Set the group ID of the plugin in the repository.
        Parameters:
        groupId - a groupId object.
      • setVersion

        public void setVersion​(java.lang.String version)
        Set the version (or valid range of versions) of the plugin to be used.
        Parameters:
        version - a version object.
      • flushExecutionMap

        public void flushExecutionMap()
        Reset the executionMap field to null
      • getExecutionsAsMap

        public java.util.Map getExecutionsAsMap()
        Returns:
        a Map of executions field with PluginExecution#getId() as key
        See Also:
        PluginExecution.getId()
      • 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 -
        artifactId -
        Returns:
        the key of the plugin, ie groupId:artifactId
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()