Skip to content

Fix #11796: Preserve cross-lifecycle default phase bindings from components.xml#11890

Open
gnodet wants to merge 1 commit intomasterfrom
ci-issue-11796-default-phases
Open

Fix #11796: Preserve cross-lifecycle default phase bindings from components.xml#11890
gnodet wants to merge 1 commit intomasterfrom
ci-issue-11796-default-phases

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Apr 3, 2026

Summary

  • Fixes Maven 4 ignoring <default-phases> from components.xml when they bind goals to standard lifecycle phases (e.g. process-sources) rather than to the custom lifecycle's own phases
  • The LifecycleWrapperProvider.wrap() method now separates v3phases() (for phase ordering) from phases() (for plugin binding extraction), preserving cross-lifecycle bindings during the round-trip conversion
  • Adds test verifying that cross-lifecycle default phase bindings survive the legacy-to-API-to-legacy Lifecycle conversion

Closes #11796

Test plan

  • New unit test testCustomLifecycleWithCrossLifecycleDefaultPhases verifies cross-lifecycle bindings are preserved
  • All 544 existing maven-core tests pass with no regressions
  • Manual test with reproducer from https://github.com/mariuszs/extension-maven-plugin

🤖 Generated with Claude Code

Claude Code on behalf of Guillaume Nodet

…onents.xml

When a plugin registers a custom lifecycle via components.xml with
<default-phases> binding goals to standard lifecycle phases (e.g.
process-sources), these cross-lifecycle bindings were silently dropped
during the legacy-to-API Lifecycle conversion. The wrap() method only
created Phase objects for the custom lifecycle's own phases, losing
any bindings to phases from other lifecycles.

The fix separates v3phases() (used by computePhases() for phase
ordering) from phases() (used by allPhases() for extracting plugin
bindings). Cross-lifecycle phase bindings are now included in phases()
so they survive the round-trip conversion back to a legacy Lifecycle,
while v3phases() returns only the lifecycle's own phases to avoid
polluting the phase-to-lifecycle map.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maven 4 ignores <default-phases> from components.xml for standard lifecycle phases

1 participant