Class PluginExecution

java.lang.Object
org.apache.maven.api.model.ConfigurationContainer
org.apache.maven.api.model.PluginExecution
All Implemented Interfaces:
Serializable, InputLocationTracker

The <execution> element contains informations required for the execution of a plugin.
See Also:
  • Field Details

  • Method Details

    • getId

      public String getId()
      The identifier of this execution for labelling the goals during the build, and for matching executions to merge during inheritance and profile injection.
      Returns:
      a String
    • getPhase

      public String getPhase()
      The build lifecycle phase to bind the goals in this execution to. If omitted, the goals will be bound to the default phase specified by the plugin.
      Returns:
      a String
    • getPriority

      public int getPriority()
      The priority of this execution compared to other executions which are bound to the same phase. Warning: This is an internal utility property that is only public for technical reasons, it is not part of the public API. In particular, this property can be changed or deleted without prior notice.
      Returns:
      a int
    • getGoals

      @Nonnull public List<String> getGoals()
      The goals to execute with the given configuration.
      Returns:
      a List<String>
    • getLocation

      public InputLocation getLocation(Object key)
      Gets the location of the specified field in the input source.
      Specified by:
      getLocation in interface InputLocationTracker
      Overrides:
      getLocation in class ConfigurationContainer
    • with

      Creates a new builder with this object as the basis.
      Overrides:
      with in class ConfigurationContainer
      Returns:
      a Builder
    • withInherited

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

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

      @Nonnull public PluginExecution withId(String id)
      Creates a new PluginExecution instance using the specified id.
      Parameters:
      id - the new String to use
      Returns:
      a PluginExecution with the specified id
    • withPhase

      @Nonnull public PluginExecution withPhase(String phase)
      Creates a new PluginExecution instance using the specified phase.
      Parameters:
      phase - the new String to use
      Returns:
      a PluginExecution with the specified phase
    • withPriority

      @Nonnull public PluginExecution withPriority(int priority)
      Creates a new PluginExecution instance using the specified priority.
      Parameters:
      priority - the new int to use
      Returns:
      a PluginExecution with the specified priority
    • withGoals

      @Nonnull public PluginExecution withGoals(Collection<String> goals)
      Creates a new PluginExecution instance using the specified goals.
      Parameters:
      goals - the new Collection<String> to use
      Returns:
      a PluginExecution with the specified goals
    • newInstance

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

      @Nonnull public static PluginExecution newInstance(boolean withDefaults)
      Creates a new PluginExecution 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 PluginExecution
    • newBuilder

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

      @Nonnull public static PluginExecution.Builder newBuilder(boolean withDefaults)
      Creates a new PluginExecution 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 PluginExecution.Builder newBuilder(PluginExecution from)
      Creates a new PluginExecution builder instance using the specified object as a basis. Equivalent to newBuilder( from, false ).
      Parameters:
      from - the PluginExecution instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

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

      public String toString()
      Overrides:
      toString in class Object