Repository navigation
[Backport maven-4.0.x] #12377: Remove Profile getSource / setSource - #14069
Conversation
…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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
…ce, 4.1.0+ has clean toString only
…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]>
Backport of #12377 to
maven-4.0.x.Profile.SOURCE_POM.equals(profile.getSource())withisFromPom()using InputLocation/InputSource detection in DefaultProfileSelector,
ConditionProfileActivator, and PropertyProfileActivator
cascading-specific tests disabled with
@DisabledBranch adaptation: replaced
InputSource.of()factory calls (master API)with
new InputSource()constructors (4.0.x API) in the test.Cherry-picked from b0da053.