You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v4 API: Partial/filtered lifecycle execution for IDE embedders #13517
There is no Maven API for "execute a filtered subset of the lifecycle execution plan."
IDE embedders must reimplement the MojoExecutor inner loop mojo-by-mojo.
Who needs this
m2e: Computes the full lifecycle plan via LifecycleExecutor.calculateExecutionPlan(),
filters it through lifecycle mapping metadata (classifying each mojo as
execute/configurator/ignore/error), then executes surviving mojos in lifecycle order
one at a time. Because there's no API for running a filtered plan, m2e manually:
Calls LifecycleExecutionPlanCalculator.setupMojoExecution() per mojo
Calls MojoExecutor.ensureDependenciesAreResolved() per mojo (redundant — should
happen once at phase boundaries)
Snapshots/restores project artifact state around each mojo to prevent cascading
side-effects (unnecessary if Maven ran the plan as a unit)
What's needed
A v4 API for executing a filtered subset of the lifecycle execution plan with proper
phase-boundary handling. Either:
// Option A: execute a filtered plansession.executePartialPlan(project, List<MojoExecution> filteredPlan)
// Option B: predicate/filter on the lifecycle enginesession.executeLifecycle(project, mojoExecution -> filter.test(mojoExecution))
This lets Maven handle dependency resolution at proper phase boundaries, manage mojo
ordering and dependency contexts correctly, and eliminates the snapshot/restore hack.
This fits naturally as a feature of #13472 (v4 execution service) or #13464 (lifecycle
engine).
🤖 Drafted with Claude Code (Claude Opus 4.6, interactive mode). Reviewed and confirmed by @gnodet before submission.
Activity