gnodet commented on issue #13230: URL: https://github.com/apache/maven/issues/13230#issuecomment-5766886971
## Follow-up: `--skip-phases` for 4.1.0 The second part of this fix (targeted at 4.1.0 / master) is the introduction of a proper `--skip-phases` CLI option as a plugin-agnostic replacement for ad-hoc conventions like `-DskipTests`. ### Design **Syntax:** ``` mvn verify --skip-phases=test,integration-test ``` Comma-separated list of phase names to skip. Option name: `--skip-phases` (long only, no short alias). **Semantics:** Phase skipping is **mojo-level inhibition**, not graph surgery. The skipped phases remain in the DAG — their predecessors and successors are unaffected. Only the mojo executions bound to a skipped phase are suppressed. This mirrors what `-DskipTests` does for Surefire, but as a first-class CLI feature that works uniformly across all plugins. Example: `--skip-phases=test,integration-test` on `mvn verify` runs compile, resources, test-compile, test-resources, package, and verify — but skips all mojos bound to `test` and `integration-test`. **Implementation touch points:** 1. `MavenOptions` (API) — add `Optional<List<String>> skippedPhases()` 2. `CommonsCliMavenOptions` + `CLIManager` — register the option, parse comma-separated values 3. `LayeredMavenOptions` — merge via `collectListIfPresentOrEmpty` 4. `MavenExecutionRequest` — add `getSkippedPhases()` / `setSkippedPhases()` 5. `MavenInvoker.populateRequest()` — wire option → request 6. `BuildPlanExecutor.plan()` — when attaching mojos to a `BuildStep`, skip if `resolvedPhase` is in the skipped set 7. The sequential builder path (single-threaded / multi-threaded) needs the same guard The skipped-phase set should be propagated via `MavenSession` so that both the concurrent and sequential builder paths can access it uniformly without duplicating the check. -- 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]
