[maven-4.0.x] Fix profile source tracking in multi-module projects (fixes #11409) (#11440) - #11466
Merged
Merged
Conversation
) (apache#11440) The root cause was that ModelBuilderResult.getActivePomProfiles() returned all active profiles as a flat list without tracking which model each profile came from. This commit: - Adds getActivePomProfiles(String modelId) and getActivePomProfilesByModel() methods to ModelBuilderResult API to track profiles per model like Maven 3 did - Updates DefaultModelBuilder to track model IDs when adding profiles, using ModelProblemUtils.toId() to get groupId:artifactId:version format (without packaging) to match Maven 3 behavior - Updates DefaultProjectBuilder to use the new per-model profile tracking API to correctly set injected profile IDs - Adds integration test MavenITgh11409ProfileSourceTest to verify the fix and prevent regression Profile sources now correctly show groupId:artifactId:version format, matching Maven 3 behavior. Fixes apache#11409 (cherry picked from commit 405e2e1) # Conflicts: # impl/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java
gnodet
force-pushed
the
backport/maven-4.0.x/pr-11440
branch
from
November 18, 2025 19:48
12a4262 to
6a4cd98
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.
Backport
This will backport the following commits from
mastertomaven-4.0.x:Questions ?
Please refer to the Backport tool documentation