Interface Lifecycle

All Superinterfaces:
ExtensibleEnum

@Experimental @Immutable public interface Lifecycle extends ExtensibleEnum
A Maven lifecycle is a sequence of predefined phases that govern the build process of a Maven project. Each phase represents a specific step, such as compiling the code, running tests, packaging the project, and deploying it. Executing a phase triggers all preceding phases, ensuring that each step of the build process is completed in the correct order. The three main lifecycles in Maven are default, clean, and site, with the default lifecycle being the most commonly used for project builds.
Since:
4.0.0
  • Field Details

  • Method Details

    • id

      String id()
      Name or identifier of this lifecycle.
      Specified by:
      id in interface ExtensibleEnum
      Returns:
      the unique identifier for this lifecycle
    • phases

      Collection of main phases for this lifecycle.
      Returns:
      the collection of top-level phases in this lifecycle
    • v3phases

      default Collection<Lifecycle.Phase> v3phases()
      Collection of main phases for this lifecycle used with the Maven 3 builders. Those builders do not operate on a graph, but on the list and expect a slightly different ordering (mainly unit test being executed before packaging).
      Returns:
      the collection of phases in Maven 3 compatible ordering
    • allPhases

      default Stream<Lifecycle.Phase> allPhases()
      Stream of phases containing all child phases recursively.
      Returns:
      a stream of all phases in this lifecycle, including nested phases
    • aliases

      Collection of aliases for this lifecycle. Aliases map Maven 3 phase names to their Maven 4 equivalents.
      Returns:
      the collection of phase aliases