Skip to content

Migrate lifecycle engine to v4 API #13464

Open

Description

@gnodet

Part of #13460 — Migrate Maven internals from v3 to v4 API

Context

The lifecycle execution pipeline is the largest v3 hotspot (~44 files) and the heart of Maven's build execution. Every class in the chain operates on v3 MavenSession, MavenProject, and MojoExecution.

Goal

Migrate the lifecycle engine to work with v4 types internally. This is the biggest phase and will likely need to be broken into sub-phases.

Key files (non-exhaustive)

Execution pipeline:

  • LifecycleStarter → BuildPlanExecutor → LifecycleModuleBuilder
  • MojoExecutor (both sequential and concurrent variants)
  • MultiThreadedBuilder, SingleThreadedBuilder, BuilderCommon
  • ConcurrencyDependencyGraph

Plan calculation:

  • DefaultLifecycleExecutionPlanCalculator
  • DefaultLifecycleTaskSegmentCalculator
  • BuildPlan, BuildStep, BuildPlanLogger

Resolution:

  • LifecycleDependencyResolver
  • LifecyclePluginResolver
  • DefaultProjectArtifactFactory

Approach

This phase is large enough to warrant sub-phases:

  1. Define v4 lifecycle execution interfaces if needed (or reuse existing MojoExecution from v4 API)
  2. Migrate plan calculation to v4 types
  3. Migrate MojoExecutor to work with v4 MojoExecution, Project, Session
  4. Migrate builders (multi-threaded, single-threaded)
  5. Migrate LifecycleModuleBuilder and BuildPlanExecutor

Dependencies

Complexity

Very high. ~44 files, deeply intertwined. Likely 3-5 sub-phases.

Claude Code on behalf of Guillaume Nodet

Activity

  1. added
    enhancement
    on Oct 13, 2026
  2. gnodet commented on Oct 14, 2026

    @gnodet
    ContributorAuthor

    Cross-referencing #13499 — the lifecycle engine migration should explicitly scope the public SPI contract for lifecycle participation (replacement for AbstractMavenLifecycleParticipant and ProjectExecutionListener).

    Tycho's analysis shows the v4 Listener/Event mechanism is too generic for build extensions that need structured callbacks with mutable project access at specific lifecycle points (afterProjectsRead, per-project before/after execution with execution plan inspection).

    Claude Code on behalf of Guillaume Nodet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions