Package org.apache.maven.api.model
Class PluginExecution
java.lang.Object
org.apache.maven.api.model.ConfigurationContainer
org.apache.maven.api.model.PluginExecution
- All Implemented Interfaces:
Serializable
,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class PluginExecution
extends ConfigurationContainer
implements Serializable, InputLocationTracker
The
@lt;execution>
element contains information required for the
execution of a plugin.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create PluginExecution instances. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
PluginExecution
(PluginExecution.Builder builder) Constructor for this class, to be called from its subclasses andPluginExecution.Builder
. -
Method Summary
Modifier and TypeMethodDescriptiongetGoals()
The goals to execute with the given configuration.getId()
The identifier of this execution for labelling the goals during the build, and for matching executions to merge during inheritance and profile injection.getLocation
(Object key) Gets the location of the specified field in the input source.Gets the keys of the locations of the input source.getPhase()
The build lifecycle phase to bind the goals in this execution to.int
The priority of this execution compared to other executions which are bound to the same phase.static PluginExecution.Builder
Creates a newPluginExecution
builder instance.static PluginExecution.Builder
newBuilder
(boolean withDefaults) Creates a newPluginExecution
builder instance using default values or not.static PluginExecution.Builder
newBuilder
(PluginExecution from) Creates a newPluginExecution
builder instance using the specified object as a basis.static PluginExecution.Builder
newBuilder
(PluginExecution from, boolean forceCopy) Creates a newPluginExecution
builder instance using the specified object as a basis.static PluginExecution
Creates a newPluginExecution
instance.static PluginExecution
newInstance
(boolean withDefaults) Creates a newPluginExecution
instance using default values or not.toString()
with()
Creates a new builder with this object as the basis.withConfiguration
(XmlNode configuration) Creates a newPluginExecution
instance using the specified configuration.withGoals
(Collection<String> goals) Creates a newPluginExecution
instance using the specified goals.Creates a newPluginExecution
instance using the specified id.withInherited
(String inherited) Creates a newPluginExecution
instance using the specified inherited.Creates a newPluginExecution
instance using the specified phase.withPriority
(int priority) Creates a newPluginExecution
instance using the specified priority.Methods inherited from class org.apache.maven.api.model.ConfigurationContainer
getConfiguration, getImportedFrom, getInherited, isInherited, newBuilder, newBuilder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.maven.api.model.InputLocationTracker
getImportedFrom
-
Field Details
-
DEFAULT_EXECUTION_ID
- See Also:
-
-
Constructor Details
-
PluginExecution
Constructor for this class, to be called from its subclasses andPluginExecution.Builder
.- See Also:
-
-
Method Details
-
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
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. Executions derived from the default lifecycle have a negative priority by default so that they are executed before any custom plugin executions.- Returns:
- a
int
- Since:
- Maven 4.0.0
-
getGoals
The goals to execute with the given configuration.- Returns:
- a
List<String>
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocation
in interfaceInputLocationTracker
- Overrides:
getLocation
in classConfigurationContainer
-
getLocationKeys
Gets the keys of the locations of the input source.- Overrides:
getLocationKeys
in classConfigurationContainer
-
with
Creates a new builder with this object as the basis.- Overrides:
with
in classConfigurationContainer
- Returns:
- a
Builder
-
withInherited
Creates a newPluginExecution
instance using the specified inherited.- Overrides:
withInherited
in classConfigurationContainer
- Parameters:
inherited
- the newString
to use- Returns:
- a
PluginExecution
with the specified inherited
-
withConfiguration
Creates a newPluginExecution
instance using the specified configuration.- Overrides:
withConfiguration
in classConfigurationContainer
- Parameters:
configuration
- the newXmlNode
to use- Returns:
- a
PluginExecution
with the specified configuration
-
withId
Creates a newPluginExecution
instance using the specified id.- Parameters:
id
- the newString
to use- Returns:
- a
PluginExecution
with the specified id
-
withPhase
Creates a newPluginExecution
instance using the specified phase.- Parameters:
phase
- the newString
to use- Returns:
- a
PluginExecution
with the specified phase
-
withPriority
Creates a newPluginExecution
instance using the specified priority.- Parameters:
priority
- the newint
to use- Returns:
- a
PluginExecution
with the specified priority
-
withGoals
Creates a newPluginExecution
instance using the specified goals.- Parameters:
goals
- the newCollection<String>
to use- Returns:
- a
PluginExecution
with the specified goals
-
newInstance
Creates a newPluginExecution
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
PluginExecution
- See Also:
-
newInstance
Creates a newPluginExecution
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
PluginExecution
-
newBuilder
Creates a newPluginExecution
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newPluginExecution
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newPluginExecution
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- thePluginExecution
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newPluginExecution
builder instance using the specified object as a basis.- Parameters:
from
- thePluginExecution
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
toString
-