gnodet opened a new issue, #13517:
URL: https://github.com/apache/maven/issues/13517

   **Parent:** #13499 | **Related:** #13472, #13464
   
   ## Problem
   
   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:
   
   ```java
   // Option A: execute a filtered plan
   session.executePartialPlan(project, List<MojoExecution> filteredPlan)
   
   // Option B: predicate/filter on the lifecycle engine
   session.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).
   
   <!-- AI-Agent-Disclosure -->
   > 🤖 Drafted with Claude Code (Claude Opus 4.6, interactive mode). Reviewed 
and confirmed by @gnodet before submission.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to