GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [#12288] Pass settings.xml profile properties to LRM by gnodet · Pull Request #12297 · apache/maven

Conversation

@gnodet

@gnodet gnodet commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #12288.

Supersedes #12291 — preserves the original commits by @ascheman with review fixes applied on top.

Original fix (by @ascheman):
Profiles activated through settings.xml (<activeProfiles> or <activation><activeByDefault>true</activeByDefault>) had their <properties> block dropped before the resolver session was built, so aether.* configuration declared in such a profile silently failed. The same <properties> on the same <profile> worked when activated via CLI -P.

Review fixes applied:

  1. Replaced redundant request.getActiveProfiles() call with inactive profile collection, so -P !profileId properly excludes activeByDefault profiles
  2. Renamed IT class to MavenITgh12288... following project naming convention

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ascheman and others added 3 commits June 17, 2026 15:29
@ascheman @gnodet
[#12288] Add ITs for settings.xml profile -> LRM
7725eaf
Adds two integration tests asserting that <properties> declared in
a settings.xml <profile> reach the resolver session config before
the LocalRepositoryManager is initialized.

The fixtures use aether.enhancedLocalRepository.{split,localPrefix}
because those have an observable effect on the install path, but the
propagation gap covered by the tests applies to any profile property.
Only the profile's <properties> block is consumed; the profile's
<plugins>, <dependencies>, <repositories>, etc. are not in scope here.

Both settings.xml-only activation channels are covered:
* testActiveByDefaultProfile -- <activation><activeByDefault>true</...
* testActiveProfilesList     -- <activeProfiles><activeProfile>...

On unmodified master, testActiveByDefaultProfile is RED (the bug) and
testActiveProfilesList is GREEN (acts as a regression guard for the
channel that already propagates correctly).
@ascheman @gnodet
[#12288] Pass settings.xml profile props to LRM
3e2c756
DefaultRepositorySystemSessionFactory#getPropertiesFromRequestedProfiles
previously only considered CLI-activated profile ids (-P). Profiles
activated through settings.xml (<activeProfiles> or <activeByDefault>)
were filtered out, so any <properties> they declared were dropped
before the resolver session was built. aether.* configuration was the
most visible casualty (LRM split/localPrefix etc.), but the gap
affects every property declared in such a profile.

The fix only touches profile <properties>; other profile content
(<plugins>, <dependencies>, <repositories>, ...) is unchanged and
keeps flowing through its existing project/build channels.

Extend the active-profile-id set with request.getActiveProfiles() and
add an isActiveByDefault() branch to the filter.

Note: this does not re-implement the full DefaultProfileSelector
semantics (e.g. activeByDefault deactivation when other profiles of
the same source are active). For the property-propagation use case in
scope of #12288 this is sufficient; injecting ProfileSelector here
would be a larger refactor in a session-build hot path and is left to
a follow-up if needed.
@gnodet
Address review feedback: fix activeByDefault deactivation and rename IT
5785235
- Replace redundant request.getActiveProfiles() call with inactive
  profile collection so -P !profileId properly excludes activeByDefault
  profiles
- Rename IT class to MavenITgh12288... following project naming convention
This was referenced Jun 17, 2026
[#12288] Pass settings.xml profile properties to LRM #12291
Closed
[#12288] Add -P !profile deactivation regression guard #12298
Merged
@gnodet
gnodet merged commit 8e86999 into master Jun 17, 2026
19 of 21 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@gnodet
gnodet deleted the gnodet/gh-12288-lrm-profile-properties branch June 17, 2026 16:43
@gnodet gnodet mentioned this pull request Jun 17, 2026
[Backport 4.0.x] [#12288] Pass settings.xml profile properties to LRM #12299
Merged
This was referenced Jun 17, 2026
[#12288] Doc: <activation> limit on resolver-config profiles apache/maven-site#1602
Merged
Profile-level properties from a settings.xml-activated profile are dropped before LRM init #12288
Closed
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

@gnodet Please assign appropriate label to PR according to the type of change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added this to the 4.1.0 milestone Jun 17, 2026
@github-actions github-actions Bot assigned gnodet Jun 17, 2026
@ascheman ascheman mentioned this pull request Jun 20, 2026
[#12288] Backport: settings.xml activeByDefault profile props to LRM #12333
Merged
ascheman added a commit that referenced this pull request Jun 22, 2026
@ascheman @gnodet
[#12288] Pass settings.xml activeByDefault profile props to LRM
74f3adb
Backport of the master fix (#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 ([#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 <[email protected]>
@gnodet gnodet added the bug Something isn't working label Jun 23, 2026
ascheman added a commit to apache/maven-site that referenced this pull request Jul 18, 2026
@ascheman
[#12288] Doc <activation> limit on resolver props
53d9b5c
The aether.* properties declared in a settings.xml <profile> only take
effect if the profile is listed under <activeProfiles> or activated via
CLI -P. The limitation has been documented since MNG-7850 (2023), but
only in the resolver-transport mini-guide -- users coming from the
profile side never find it.

* mini/guide-resolver-transport.md -- strengthen the NOTICE to enumerate
  all <activation> conditions affected (not just activeByDefault) and
  spell out the timing reason in one sentence.
* introduction/introduction-to-profiles.md -- add a Note for resolver
  configuration sentence in the Active by default section, with
  cross-link to the mini-guide caveat.

Wording is accurate for current Maven 3.x and Maven 4 RCs. apache/maven#12297
fixes the activeByDefault case on Maven 4 master; once that release
ships and the backport question is settled, this doc should be updated
to qualify the limitation to specific version ranges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gnodet gnodet

Labels

bug Something isn't working

Projects

None yet

Milestone

4.2.0

Development

Successfully merging this pull request may close these issues.

Profile-level properties from a settings.xml-activated profile are dropped before LRM init

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@gnodet @ascheman
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.