Class Plugin

All Implemented Interfaces:
Serializable, InputLocationTracker

The <plugin> element contains information required for a plugin.
See Also:
  • Method Details

    • getGroupId

      public String getGroupId()
      The group ID of the plugin in the repository.
      Returns:
      a String
    • getArtifactId

      public String getArtifactId()
      The artifact ID of the plugin in the repository.
      Returns:
      a String
    • getVersion

      public String getVersion()
      The version (or valid range of versions) of the plugin to be used.
      Returns:
      a String
    • getExtensions

      public 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 is String for technical reasons, the semantic type is actually Boolean. Default value is false.
      Returns:
      a String
    • getExecutions

      @Nonnull public List<PluginExecution> 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

      @Nonnull public List<Dependency> getDependencies()
      Additional dependencies that this project needs to introduce to the plugin's classloader.
      Returns:
      a List<Dependency>
    • with

      @Nonnull public Plugin.Builder with()
      Creates a new builder with this object as the basis.
      Overrides:
      with in class ConfigurationContainer
      Returns:
      a Builder
    • withInherited

      @Nonnull public Plugin withInherited(String inherited)
      Creates a new Plugin instance using the specified inherited.
      Overrides:
      withInherited in class ConfigurationContainer
      Parameters:
      inherited - the new String to use
      Returns:
      a Plugin with the specified inherited
    • withConfiguration

      @Nonnull public Plugin withConfiguration(XmlNode configuration)
      Creates a new Plugin instance using the specified configuration.
      Overrides:
      withConfiguration in class ConfigurationContainer
      Parameters:
      configuration - the new XmlNode to use
      Returns:
      a Plugin with the specified configuration
    • withGroupId

      @Nonnull public Plugin withGroupId(String groupId)
      Creates a new Plugin instance using the specified groupId.
      Parameters:
      groupId - the new String to use
      Returns:
      a Plugin with the specified groupId
    • withArtifactId

      @Nonnull public Plugin withArtifactId(String artifactId)
      Creates a new Plugin instance using the specified artifactId.
      Parameters:
      artifactId - the new String to use
      Returns:
      a Plugin with the specified artifactId
    • withVersion

      @Nonnull public Plugin withVersion(String version)
      Creates a new Plugin instance using the specified version.
      Parameters:
      version - the new String to use
      Returns:
      a Plugin with the specified version
    • withExtensions

      @Nonnull public Plugin withExtensions(String extensions)
      Creates a new Plugin instance using the specified extensions.
      Parameters:
      extensions - the new String to use
      Returns:
      a Plugin with the specified extensions
    • withExecutions

      @Nonnull public Plugin withExecutions(Collection<PluginExecution> executions)
      Creates a new Plugin instance using the specified executions.
      Parameters:
      executions - the new Collection<PluginExecution> to use
      Returns:
      a Plugin with the specified executions
    • withDependencies

      @Nonnull public Plugin withDependencies(Collection<Dependency> dependencies)
      Creates a new Plugin instance using the specified dependencies.
      Parameters:
      dependencies - the new Collection<Dependency> to use
      Returns:
      a Plugin with the specified dependencies
    • newInstance

      @Nonnull public static Plugin newInstance()
      Creates a new Plugin instance. Equivalent to newInstance(true).
      Returns:
      a new Plugin
      See Also:
    • newInstance

      @Nonnull public static Plugin newInstance(boolean withDefaults)
      Creates a new Plugin instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Plugin
    • newBuilder

      @Nonnull public static Plugin.Builder newBuilder()
      Creates a new Plugin builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static Plugin.Builder newBuilder(boolean withDefaults)
      Creates a new Plugin builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Plugin.Builder newBuilder(Plugin from)
      Creates a new Plugin builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Plugin instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Plugin.Builder newBuilder(Plugin from, boolean forceCopy)
      Creates a new Plugin builder instance using the specified object as a basis.
      Parameters:
      from - the Plugin instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder
    • isExtensions

      public boolean isExtensions()
    • flushExecutionMap

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

      public Map<String,PluginExecution> getExecutionsAsMap()
      Returns:
      a Map of executions field with PluginExecution#getId() as key
      See Also:
    • getId

      public String getId()
      Gets the identifier of the plugin.
      Returns:
      the plugin id in the form <groupId>:<artifactId>:<version>, never null
    • 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 repository
      artifactId - 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 class Object
      See Also:
    • hashCode

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

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