[#12288] Backport: settings.xml activeByDefault profile props to LRM#12333
Open
ascheman wants to merge 1 commit into
Open
[#12288] Backport: settings.xml activeByDefault profile props to LRM#12333ascheman wants to merge 1 commit into
ascheman wants to merge 1 commit into
Conversation
Backport of the master fix (apache#12297) and gnodet's review hardening to the maven-3.10.x line. On 3.x, request.getActiveProfiles() already covers both CLI -P and settings.xml <activeProfiles>, so only the <activeByDefault> channel was broken. The activeByDefault filter is guarded against -P !id deactivation per gnodet's review feedback. Cherry-picks could not be applied verbatim due to path and API divergence: * Path: 3.x has maven-core/src/main/java/..., master has impl/maven-core/src/main/java/... * API: 3.x exposes request.getActiveProfiles() / getInactiveProfiles() returning List<String>; master uses request.getProfileActivation().get{Required,Optional}{Active,Inactive} ProfileIds(). The minimal-diff adaptation here only adds the activeByDefault branch and -P !id guard; the existing settings.xml <activeProfiles> propagation is unchanged. Master origin commits: * 3e2c756 ([apache#12288] fix) * 5785235 (gnodet review hardening) Integration tests live in apache/maven-integration-testing and are addressed in a separate PR. Co-Authored-By: Guillaume Nodet <gnodet@gmail.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.
@gnodet — for review (you endorsed this backport in #12288).
Backport of #12297 (merged on master, also backported to
maven-4.0.xvia #12299) to the
maven-3.10.xmaintenance line:What changes (on 3.x)
Adapted minimal-diff (4 net lines added to
DefaultRepositorySystemSessionFactory#getPropertiesFromRequestedProfiles):<activation><activeByDefault>true</activeByDefault>branch tothe profile filter — this is the actual gap on 3.x.
-P !iddeactivation guard (per the review hardening onmaster,
57852351).On 3.x,
request.getActiveProfiles()already returns CLI-P+ settings.xml<activeProfiles>, so the master fix's additional propagation of thosechannels is not needed on this line. Only
<activeByDefault>wasbroken on 3.10.x.
Why not a verbatim cherry-pick
Path and API divergence between master and 3.10.x prevented a clean
cherry-pick -x:impl/maven-core/src/main/java/...; 3.x hasmaven-core/src/main/java/....request.getProfileActivation().get{Required,Optional}{Active,Inactive}ProfileIds();3.x uses
request.getActiveProfiles()/getInactiveProfiles()returningList<String>.The commit body explicitly cites the master origin commits
(
3e2c7560and57852351) for traceability.Tests
Integration tests for #12288 on the 3.x line live in
apache/maven-integration-testingand are addressed by a parallel PR there (will reference here once open).
The IT coverage includes:
testActiveByDefaultProfile(master7725eaf2)testActiveProfilesList(master7725eaf2, baseline regression guard)testActiveByDefaultDeactivatedViaCli(master [#12288] Add -P !profile deactivation regression guard #12298, regression guard forthe
-P !iddeactivation that is also in this PR)Locally:
mvn -pl maven-core -am clean install— green.References #12288, #12297, #12298, #12299.