Skip to content

v4 SPI: Lifecycle participation (afterProjectsRead, per-project callbacks, session end) #13514

Closed

Description

@gnodet

Parent: #13499 | Depends on: #13464, #13462

Problem

There is no v4 API/SPI equivalent of AbstractMavenLifecycleParticipant or
ProjectExecutionListener. The v4 Listener/Event mechanism is too generic —
it fires untyped Event objects without structured callbacks or mutable project access.

Who needs this

  • Tycho: TychoMavenLifecycleParticipant.afterProjectsRead() resolves the P2 target
    platform and injects OSGi dependencies into every MavenProject before any mojo executes.
    TychoProjectExecutionListener.beforeProjectLifecycleExecution() does lazy per-project
    P2 resolution with execution plan inspection.
  • m2e: Invokes lifecycle participants (including Tycho's) when reading/refreshing
    workspace projects. Both a consumer and invoker of this SPI.

What's needed

A lifecycle participation SPI in org.apache.maven.api.spi with:

  • afterProjectsRead equivalent — access to the full reactor project list with ability
    to mutate project dependencies (via ProjectManager)
  • Per-project before/after execution callbacks — with access to the execution plan
    (list of MojoExecution for the project)
  • Session end callback — for cleanup/disposal
  • Session cloning or equivalent for parallel work

Notes

🤖 Drafted with Claude Code (Claude Opus 4.6, interactive mode). Reviewed and confirmed by @gnodet before submission.

Activity

  1. added
    enhancement
    on Oct 14, 2026
  2. added a commit that references this issue on Nov 13, 2026
    104d62c
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