[MNG-11133] Fix mixin property precedence - mixins should override parent properties#11141
Open
gnodet wants to merge 1 commit into
Open
[MNG-11133] Fix mixin property precedence - mixins should override parent properties#11141gnodet wants to merge 1 commit into
gnodet wants to merge 1 commit into
Conversation
6cad66a to
8082092
Compare
8082092 to
0cc534c
Compare
…rent properties Ensures that properties defined in mixins take precedence over properties inherited from parent POMs. The fix maintains correct consumer POM generation while properly resolving the mixin property precedence order.
49ab6cf to
d7968fe
Compare
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
Fixes MNG-11133 where mixin properties were not overriding properties inherited from the parent.
Problem
Mixins are applied after parent inheritance, but the merge was using
sourceDominant=false, causing the existing model's properties to win over the mixin's properties. This meant that parent properties would override mixin properties, which is incorrect behavior.For example:
maven.compiler.release=11maven.compiler.release=2121(mixin wins)11(parent wins)Solution
DefaultInheritanceAssemblerto control source dominance during model inheritancesourceDominant=truewhen applying mixins so mixin properties override previously inherited onesChanges
Core Changes
sourceDominantparametersourceDominant=truewhen applying mixins in two places:Test Changes
maven.compiler.release=11maven.compiler.release=2121(mixin wins)Testing
The integration test should fail before the fix and pass after the fix, confirming that the bug is reproduced and resolved.
Backward Compatibility
This change corrects the behavior to match the expected semantics of mixins. While it changes the effective property values in some cases, it aligns with the documented and expected behavior that mixins should override parent properties.
Note: This is a draft PR. The integration test may need the full Maven build to run properly due to dependencies on IT support modules.
Pull Request opened by Augment Code with guidance from the PR author