Fix #11796: Preserve default-phases bindings for standard lifecycle phases#11889
Open
Fix #11796: Preserve default-phases bindings for standard lifecycle phases#11889
Conversation
…hases When a custom lifecycle registered via components.xml maps plugin goals to standard lifecycle phases (e.g., process-sources) via <default-phases>, the LifecycleWrapperProvider now includes those entries as additional phases in the wrapped API Lifecycle. The v3phases() method is overridden to return only the custom lifecycle's own phases, ensuring computePhases() is unaffected while getDefaultPhases() correctly picks up the bindings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<default-phases>fromcomponents.xmlwhen plugin goals are bound to standard lifecycle phases (e.g.,process-sources)LifecycleWrapperProvider.wrap()which only createdPhaseobjects for the custom lifecycle's own phase names, ignoringdefaultPhasesentries that reference standard lifecycle phasesdefaultPhasesentries for standard phases as additional phases in the wrapped APILifecycle, and overridesv3phases()to return only the custom lifecycle's own phases (socomputePhases()is unaffected)Changes
DefaultLifecycleRegistry.java: ModifiedLifecycleWrapperProvider.wrap()to includedefaultPhasesentries for standard lifecycle phases inphases(), overridesv3phases()to isolate custom phasesDefaultLifecyclesTest.java: Added unit test verifying custom lifecycle default-phases bindings to standard phases are preservedMavenITmng11796DefaultPhasesStandardLifecycleTestwith reproducer plugin and consumer projectTest plan
process-sourcesphase viamvn compileClaude Code on behalf of Guillaume Nodet