Skip to content

[Backport maven-4.0.x] #12377: Remove Profile getSource / setSource - #14069

Merged
gnodet merged 4 commits into
apache:maven-4.0.xfrom
gnodet:backport-12377-remove-profile-source
Nov 19, 2026
Merged

gnodet merged 4 commits into
apache:maven-4.0.xfrom
gnodet:backport-12377-remove-profile-source

Conversation

@gnodet

@gnodet gnodet commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Backport of #12377 to maven-4.0.x.

  • Replace Profile.SOURCE_POM.equals(profile.getSource()) with isFromPom()
    using InputLocation/InputSource detection in DefaultProfileSelector,
    ConditionProfileActivator, and PropertyProfileActivator
  • Add ProfileSourceDetector utility class
  • Fix 4.0.0/4.0.99 compat segment to use own field instead of delegate
  • Note: cascading profile activation (from Cascading profile activation #1774) not backported;
    cascading-specific tests disabled with @Disabled

Branch adaptation: replaced InputSource.of() factory calls (master API)
with new InputSource() constructors (4.0.x API) in the test.

Cherry-picked from b0da053.

…urce

Backport of apache#12377 to maven-4.0.x.

- Replace Profile.SOURCE_POM.equals(profile.getSource()) with isFromPom()
  using InputLocation/InputSource detection in DefaultProfileSelector,
  ConditionProfileActivator, and PropertyProfileActivator
- Add ProfileSourceDetector utility class
- Fix 4.0.0/4.0.99 compat segment to use own field instead of delegate
- Note: cascading profile activation (from apache#1774) not backported;
  cascading-specific tests disabled with @disabled

Cherry-picked from b0da053

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a clean backport of #12377 to maven-4.0.x. The core logic — detecting POM vs settings profiles via InputSource.modelId instead of the mutable source field — is sound. The SettingsUtilsV4 / SettingsUtils split correctly keeps the mutable source setter on the compat model layer while removing it from the API-model layer.

One structural issue to address: isFromPom() wrappers in two classes that never call them.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isFromPom() wrappers raised in the previous review have been removed. Both ConditionProfileActivator and PropertyProfileActivator are now clean — they call ProfileSourceDetector.isFromPom() directly without intermediate delegating wrappers. This backport is good to merge.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit correctly removes the dead isFromPom() wrappers from ConditionProfileActivator and PropertyProfileActivator — that was the only open finding. The backport is clean.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet
gnodet merged commit 2eee2b6 into apache:maven-4.0.x Nov 19, 2026
24 checks passed
gnodet added a commit that referenced this pull request Nov 19, 2026
…redundant 4.2.0+ block (#14075)

getSource/setSource were removed from the 4.1.0 schema (backport #14069),
so the 4.1.0/4.1.99 block re-introducing them on master is wrong.
Collapse to 4.1.0+ with the clean toString; the 4.2.0+ block is redundant.

Co-authored-by: Guillaume Nodet <[email protected]>
@github-actions github-actions Bot added this to the 4.0.0 milestone Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants