Class Lifecycle

java.lang.Object
org.apache.maven.plugin.lifecycle.Lifecycle
All Implemented Interfaces:
Serializable

@Experimental @Generated @ThreadSafe @Immutable public class Lifecycle extends Object implements Serializable
A custom lifecycle mapping definition.
See Also:
  • Method Details

    • getId

      public String getId()
      The ID of this lifecycle, for identification in the mojo descriptor.
      Returns:
      a String
    • getPhases

      @Nonnull public List<Phase> getPhases()
      The phase mappings for this lifecycle.
      Returns:
      a List<Phase>
    • with

      @Nonnull public Lifecycle.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withId

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

      @Nonnull public Lifecycle withPhases(Collection<Phase> phases)
      Creates a new Lifecycle instance using the specified phases.
      Parameters:
      phases - the new Collection<Phase> to use
      Returns:
      a Lifecycle with the specified phases
    • newInstance

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

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

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

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

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