Skip to content

Cascading profile activation - #1774

Merged
gnodet merged 5 commits into
apache:masterfrom
gnodet:cascading-profile-activation
Oct 21, 2026
Merged

gnodet merged 5 commits into
apache:masterfrom
gnodet:cascading-profile-activation

Conversation

@gnodet

@gnodet gnodet commented Oct 4, 2024 •

Copy link
Copy Markdown
Contributor

Fixes #4637

Why

Maven profiles can be activated by properties, but there is no way for one profile's
properties to trigger another profile's activation within the same POM. Users who want
a "default" profile that enables a set of other profiles must resort to workarounds like
external scripts, wrapper POMs, or duplicating activation conditions. This has been a
long-standing request (JIRA MNG-3309, opened in 2007).

What

This PR implements cascading profile activation: when a profile activates and
defines properties, those properties are immediately available to trigger the activation
of subsequent profiles in the same POM. The mechanism iterates until no new profiles
activate (fixed-point).

Example — profile default sets enable.checks=true, which cascades to activate
run-checkstyle and run-spotbugs:

<profiles>
  <profile>
    <id>default</id>
    <activation>
      <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
      <enable.checks>true</enable.checks>
    </properties>
  </profile>
  <profile>
    <id>run-checkstyle</id>
    <activation>
      <condition>${enable.checks} == 'true'</condition>
    </activation>
    ...
  </profile>
  <profile>
    <id>run-spotbugs</id>
    <activation>
      <condition>${enable.checks} == 'true'</condition>
    </activation>
    ...
  </profile>
</profiles>

How

ProfileActivationContext SPI (backward-compatible default methods):

  • addProfileProperties(Collection<Profile>) — injects properties from newly activated
    profiles into the cascading context
  • getCascadedProfileProperty(String) — retrieves cascaded properties only (not the
    POM's own <properties>)
  • clearCascadedProfileProperties() — cleans up after activation completes

DefaultProfileSelector iterates activation in a loop until stable. Only
auto-activated profiles (matching an activator condition) cascade — explicitly activated
profiles (-P flag) and activeByDefault profiles do not inject properties into the
cascade, preventing unintended side effects.

ConditionProfileActivator resolves cascaded properties (then model properties) for
POM profiles. Property lookup order: user → system → cascaded → model.

PropertyProfileActivator also checks cascaded properties for POM profiles, using
the same user → system → cascaded order (without model property fallback, so a POM's own
<properties> cannot self-activate <property>-based profiles).

Safeguards:

  • Cascaded properties are isolated from model properties to avoid interference with
    settings profiles
  • Only POM profiles (Profile.SOURCE_POM) consult cascaded/model properties — settings
    profiles never do
  • interpolatePath uses user → system → model order so user -D flags always win
  • No instanceof coupling — activators use the SPI methods directly

🤖 Generated with Claude Code

@gnodet gnodet added this to the 4.0.0-beta-5 milestone Oct 4, 2024
@gnodet
gnodet force-pushed the cascading-profile-activation branch from 21eb346 to 1ed072b Compare October 4, 2024 20:05
@gnodet gnodet modified the milestones: 4.0.0-beta-5, 4.1.0 Oct 7, 2024
@gnodet
gnodet force-pushed the cascading-profile-activation branch 2 times, most recently from 3f184eb to 3d21d5f Compare October 25, 2024 20:36
@gnodet
gnodet marked this pull request as draft November 20, 2024 20:39
@gnodet
gnodet force-pushed the cascading-profile-activation branch from 9d59fbc to a5a3941 Compare July 4, 2025 07:49
@gnodet
gnodet marked this pull request as ready for review July 4, 2025 07:50
@gnodet
gnodet force-pushed the cascading-profile-activation branch from a5a3941 to c7edd16 Compare October 9, 2025 07:25
@gnodet
gnodet force-pushed the cascading-profile-activation branch 5 times, most recently from 4b18472 to 3dfcd05 Compare June 2, 2026 17:18
@gnodet
gnodet force-pushed the cascading-profile-activation branch 4 times, most recently from cd869f3 to b4ba025 Compare June 8, 2026 19:50
@cstamas

cstamas commented Jun 8, 2026

Copy link
Copy Markdown
Member

Is this whole PR only about cascading profile activation? There are mvnup changes for example...

gnodet added a commit to gnodet/maven that referenced this pull request Jul 10, 2026
Reviewed 3 PRs: apache#982 (PowerShell 3.9.x, syntax bugs), apache#878 (PowerShell master, needs Maven 4 rewrite), #33 (qualityManagement, oldest PR at 11 years). 45 reviews posted total. Only 3 truly unreviewed PRs remain: apache#2277, apache#1774, #71 (all large).

Co-Authored-By: Claude Opus 4.6 <[email protected]>

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

AI Review — PR #1774: [MNG-3309] Cascading profile activation

This PR implements cascading profile activation — a long-requested feature where activating one profile can trigger activation of another via properties set by the first. The core design is sound (the loop terminates correctly), but there are several issues to address.

Bug

ReportSet merge result discarded — In MavenModelMerger.java, the change from:

element = mergeReportSet(element, existing, sourceDominant, context);

to:

mergeReportSet(element, existing, sourceDominant, context);

discards the merged result. In the Maven 4 immutable model, mergeReportSet returns a new object via builder.build() — it does not mutate in place. The original unmerged element is put into the map, silently breaking ReportSet merging during inheritance. (The compat ModelMerger uses void returns, so this may have been copied from the wrong pattern.)

Correctness Concerns

1. NPE in ConditionProfileActivator — doGetProperty(Profile profile, ...) calls Profile.SOURCE_POM.equals(profile.getSource()) but ConditionParserTest passes null as the profile parameter. If any property resolution reaches the model-property fallback path, this will NPE. Current tests don't trigger it (they resolve system properties), but the code is fragile.

2. instanceof coupling for cascading API — addProfileProperties was correctly added to the ProfileActivationContext interface, but clearCascadedProfileProperties() and getModelPropertyForActivation() are only on DefaultProfileActivationContext and accessed via instanceof downcasts (4 places). Alternative implementations won't crash (they fall back), but the asymmetry is a code smell.

Behavioral Changes

  • CI-friendly parent version support removed — The deleted MavenITgh12184CIFriendlyParentVersionTest confirms ${revision} in parent version is no longer handled the same way. This needs migration guide documentation.
  • Repository validation upgraded WARNING → ERROR — Uninterpolated expressions in repository id/url now fail the build instead of warning. May break real-world builds.
  • Property lookup order changed — ConditionProfileActivator.doGetProperty now checks user → system → model (previously user → model → system). System properties now take precedence over model properties during activation.

Scope Concern

As committer cstamas noted, this PR bundles many unrelated changes (mvnup fixes, plugin version changes, consumer POM simplification, GitHub Actions downgrades) with the cascading activation feature. Splitting into focused PRs would improve reviewability.

What Works Well

The cascading activation core design is correct: the do...while loop removes activated profiles from remainingProfiles on each iteration, guaranteeing monotonic progress and termination. Circular dependencies are handled correctly (both profiles activate in the first pass). Test coverage for the cascading behavior is adequate.


This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

gnodet added a commit to gnodet/maven that referenced this pull request Jul 10, 2026
Reviewed final 3 PRs: apache#2277 (modernize codebase), apache#1774 (cascading profiles, found ReportSet merge bug), #71 (mirrors in profiles). 48 reviews posted total. All 61 open PRs have now been reviewed or skipped.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Code Review

The cascading profile activation feature (MNG-3309) is well-designed — the core mechanism in DefaultProfileSelector has proper termination (profiles removed from the remaining set after activation, guaranteeing at most N iterations). However, the PR carries a single squashed commit rebased onto master that actively reverses at least five recently-merged bug fixes:

  1. targetPath alignment reversion (DefaultModelPathTranslator.java:137): Reverts commit dac6ab1 — re-introduces the bug where Source.targetPath (relative to output directory) is incorrectly resolved against project basedir. The associated tests (DefaultModelPathTranslatorTest, ProjectBuilderTest assertions) are also deleted.

  2. Consumer POM settings.xml repos reversion (DefaultConsumerPomBuilder.java:303): Reverts commit 3656bff — removes repository/profile passing from the execution request to the model builder. Users with corporate/private repository BOMs defined in settings.xml will hit "Non-resolvable import POM" errors during consumer POM building. Test MavenITConsumerPomBomFromSettingsRepoTest is deleted.

  3. CI-friendly version interpolation reversion (DefaultModelBuilder.java:734): Reverts commit 55ee0a3 — changes from request.getSystemProperties()+request.getUserProperties() back to session.getEffectiveProperties(). When user properties on the ModelBuilderRequest differ from the Session (e.g., -Drevision=2.0.0), interpolation becomes inconsistent. Test MavenITgh12184CIFriendlyParentVersionTest is deleted.

  4. versionContainsExpression removal (DefaultModelBuilder.java:1584): Removes the special handling for parent versions containing ${...} expressions (like ${revision}) for CI-friendly parent resolution. This code was merged to master after the branch's merge base, so it's a stale-branch gap rather than an active reversion, but the regression impact is the same.

  5. Exception handler HTTPS check reversion (DefaultExceptionHandler.java:207): Reverts commit b404258 — removes the !reference.startsWith("https:") guard, causing HTTPS reference URLs to get incorrectly prepended with the cwiki URL. Also removes the ArtifactFilteredOutException handling that provided user-friendly guidance.

These are most likely merge conflict resolution artifacts from the rebase that chose the branch's pre-fix version of shared files. They should be resolved by cherry-picking the fixes into the feature branch or re-resolving conflicts.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@gnodet
gnodet force-pushed the cascading-profile-activation branch from b4ba025 to f32e5c8 Compare September 23, 2026 21:56
@gnodet

gnodet commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current `master` (as of 2026-09-23).

Conflicts resolved during rebase:

  • Infra/tooling files (lifecycle plugin versions, IT test signatures, pom.xml changes): took master's version — the PR's base was ~3 months old
  • Feature files (ProfileActivationContext, DefaultProfileActivationContext, DefaultProfileSelector, PropertyProfileActivator, ConditionProfileActivator, DefaultProfileSelectorTest): auto-merged cleanly
  • Minor adaptations needed post-rebase:
    • Added addProfileProperties() no-op to the sandboxed anonymous ProfileActivationContext in withoutUserPropertiesAndFilesystem()
    • Updated DefaultProfileSelectorTest constructor calls (DefaultPathTranslator was made package-private on master)
    • Updated ConditionParserTest to pass null as the first arg to property() (matching the new 3-arg signature)
    • Restored DefaultModelPathTranslator to not align targetPath to basedir (master added that invariant + test for it)
    • Added addProfileProperties() no-op to ExecutableFinderTest's anonymous context

Full mvn clean verify -B -DskipITs passes locally.

@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.

Re-review — PR #1774: [MNG-3309] Cascading profile activation

This rebase is a significant improvement over the previous iterations: the unrelated changes and regression reverts that prior reviews flagged are gone. The PR is now cleanly scoped to the cascading feature. Good. However, there are three issues that still need to be resolved.

Status of prior findings:

  • Scope/revert issues → ✅ Resolved by this rebase
  • ReportSet merge bug → ✅ Not present in this diff
  • NPE in ConditionProfileActivator.doGetProperty when profile == null → ❌ Still present (see below)
  • instanceof coupling → acknowledged, partially acceptable, but introduces a new variant of the problem (see below)

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

@gnodet
gnodet force-pushed the cascading-profile-activation branch from f32e5c8 to 69e3683 Compare October 16, 2026 06:23

@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.

Thanks for this cascading profile activation implementation — the idea is sound and the test coverage is solid. A few issues need to be addressed before this can merge.

Critical:

  1. SPI break: addProfileProperties is added to ProfileActivationContext without a default implementation, breaking all existing custom implementors.
  2. NPE: ConditionProfileActivator.doGetProperty is called with profile=null from ConditionParserTest, but Profile.SOURCE_POM.equals(profile.getSource()) will throw.
  3. Behavioral regression: activeByDefault profiles are temporarily added to activatedProfiles and their properties injected via addProfileProperties, but they are later potentially dropped from the final result — spurious property injection.

Design:
4–6. instanceof DefaultProfileActivationContext appears in three separate places. This hard-wires the cascading mechanism to the default implementation and silently breaks for custom SPI implementations.
7. Property lookup order changed from user→model→system to user→system→model in ConditionProfileActivator without documentation of the intentional semantic shift.
8. interpolatePath now resolves file-existence activation paths against cascaded properties — unintended side-effect.

Housekeeping:
9. New test resource POM (cascading-profile-activation/pom.xml in maven-core) has no referencing test class.
10. DefaultProfileSelectorTest duplicates the instanceof coupling in its inner PropertyProfileActivator.

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

@gnodet
gnodet force-pushed the cascading-profile-activation branch from 69e3683 to 749bfa4 Compare October 16, 2026 06:51
@gnodet
gnodet force-pushed the cascading-profile-activation branch from 749bfa4 to 826aa00 Compare October 16, 2026 06:56

@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.

Following up on my earlier review — 7 of the 10 findings are fully addressed in this iteration; 2 remain open and I've found 1 new issue.

Resolved ✅:

  • SPI break (addProfileProperties missing default) — fixed, no-op default added to interface
  • instanceof coupling on clearCascadedProfileProperties() — SPI default method now
  • instanceof coupling on getCascadedProfileProperty() in both activators — SPI method now
  • NPE when profile is null in ConditionProfileActivator — null guard added
  • Undocumented property lookup order change — Javadoc comment added to doGetProperty
  • activeByDefault spurious injection — activeByDefault profiles correctly excluded from activatedProfiles list
  • Orphaned test resource (maven-core/cascading-profile-activation/pom.xml) — removed

Still open / new issues below.

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

@gnodet
gnodet force-pushed the cascading-profile-activation branch from 826aa00 to 3d630fa Compare October 16, 2026 08:09

@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.

Following up on my earlier review — the visibility fix (getModelPropertyForActivation now private) and the inner-class coupling in the test are both resolved. One correctness bug and one missing test still need addressing.

Resolved ✅:

  • getModelPropertyForActivation visibility — now private ✅
  • DefaultProfileSelectorTest inner PropertyProfileActivator class — test now uses the real production class ✅

Still open / new issue below.

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

@gnodet
gnodet force-pushed the cascading-profile-activation branch from 3d630fa to e3bb800 Compare October 16, 2026 10:00

@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.

Following up on my earlier review — the path interpolation lookup order is fixed ✅. One finding remains.

Resolved ✅:

  • Path interpolation lookup order in interpolate() — now correctly user → system → cascaded/model, matching the documented precedence ✅

Still open:

  • Missing test for file-existence cascade behavior (see inline comment below)

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

@gnodet
gnodet force-pushed the cascading-profile-activation branch from e3bb800 to d7ebd71 Compare October 16, 2026 11:34

@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.

All prior concerns are resolved. The cascading profile activation implementation is correct and well-tested:

  • Loop termination: The remainingProfiles pool strictly shrinks on every iteration — bounded termination guaranteed.
  • Explicit activation excluded from cascading: Profiles activated via -P or activeByDefault are removed from remainingProfiles but not added to activatedProfiles, so they don't trigger cascades. testExplicitlyActivatedProfileDoesNotCascade validates this.
  • Interpolation order corrected: user → system → cascaded/model now matches ConditionProfileActivator.doGetProperty, fixing the previous instability.
  • Settings profiles guarded: Both ConditionProfileActivator and PropertyProfileActivator gate cascaded property lookup on SOURCE_POM, preventing settings profiles from participating.
  • Sandboxed context safe: addProfileProperties is a no-op, getCascadedProfileProperty returns null — no cascading leakage into external/dependency model resolution.
  • SPI backward compatible: All three new methods have default implementations.

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

@gnodet gnodet changed the title [MNG-3309] Cascading profile activation Cascading profile activation Oct 16, 2026
Cascading profile activation allows a profile to set a property that immediately
triggers the activation of subsequent profiles within the same POM.

Implementation:
- DefaultProfileSelector now iterates profile activation in a loop until stable
- Cascaded properties are stored in a separate map (DefaultProfileActivationContext)
  isolated from main model properties to avoid interference with settings profiles
- Model properties (including cascaded ones) are only consulted for POM profile
  activation (Profile.SOURCE_POM), never for settings profiles — prevents cascaded
  properties from overriding Maven system properties that affect repository resolution
- Property priority: user properties > system properties > model properties (POM only)
- Cascaded properties are cleared after each activation round

The full IT suite (1034 tests) passes locally.
@gnodet
gnodet force-pushed the cascading-profile-activation branch from d7ebd71 to c729bdb Compare October 16, 2026 13:16
gnodet and others added 3 commits October 19, 2026 21:15
# Conflicts:
#	impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultProfileActivationContext.java
…operties

After merging apache#13555, start(Map) no longer exposes parent POM properties
through getModelProperty(). The profile.pom.condition assertion expected
the parent's declared property to self-activate a condition-based profile,
which contradicts apache#13390's design intent. This aligns with apache#13556 on master.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@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.

Following up on my earlier review — the previous APPROVE was given at commit d7ebd71 (2026-10-16). Since then, three commits were added:

  1. Merge from master (2026-10-19)
  2. fix: remove pom.condition assertion (2026-10-20)
  3. docs: document cascading profile activation (2026-10-20)

The master merge silently removed the cascading activation mechanism that was the core of this PR. The new commits do not account for this regression.


⚠️ Critical regression from master merge: cascading activation is no longer implemented

The merge from master (commit 46532a35, 2026-10-19) brought in changes that completely removed the cascading mechanism:

  • DefaultProfileSelector.getActiveProfiles() is now a simple single-pass loop — the do { ... } while (!activatedProfiles.isEmpty()) cascading loop is gone.
  • ProfileActivationContext SPI no longer exposes addProfileProperties(), getCascadedProfileProperty(), or clearCascadedProfileProperties() — the cascade injection contract was removed entirely.
  • ConditionProfileActivator.doGetProperty() no longer calls context.getCascadedProfileProperty() — the cascaded lookup was stripped out.
  • PropertyProfileActivator no longer checks cascaded properties.
  • DefaultProfileSelectorTest — which had testCascadingActivation(), testCascadingActivationChain(), testCascadingWithCircularDependency(), and 12 other cascading-specific tests — was deleted entirely.

The IT test MavenITmng3309CascadingProfileActivationTest will now fail. It expects profile step1 to activate because profile trigger sets cascade.step1=activated, and profile step2 to activate because step1 sets cascade.step2=activated. None of this works anymore: during profile activation, context.getModelProperty("cascade.step1") returns null (it's not in the POM's <properties> block — it was only set by profile trigger at injection time, after activation). Without the cascading loop, profile step1 and step2 never see these properties and remain inactive.

The new documentation in maven.mdo ("When a profile is activated and defines properties, those properties are immediately available to trigger the activation of other profiles") is now inaccurate — this is no longer how Maven works after the master merge.

Required action: The PR needs to resolve the conflict between the master merge's removal of the cascading mechanism and the PR's core feature. Either:

  • Restore the cascading loop in DefaultProfileSelector (and the SPI methods, and the cascade lookups in activators) — rebasing the PR's cascading changes on top of master rather than letting the merge overwrite them; or
  • If the cascading approach was intentionally replaced, update the PR description, docs, IT tests, and test assertions to reflect the new design.

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.

Following up on my earlier review — the previous REQUEST_CHANGES (2026-10-20, SHA 8ddbcea) was based on an incorrect reading of the master merge: the cascading mechanism was NOT removed. The cascading loop, SPI methods, and cascade lookups in both activators are all present and correct. That review is retracted.

Status of the 4 commits since the Oct 16 APPROVE:

  • 46532a35 (master merge) — Correctly integrates interpolationProperties from #13555 alongside cascadedProfileProperties. Both fields coexist without conflict. ✅
  • a06ea974 (fix: remove pom.condition assertion) — Necessary and correct: after #13555, start(Map) stores parent POM properties in interpolationProperties (path interpolation only), not in the model returned by getModelProperty(). The old assertEquals("activated", ...) assertion was testing behavior that #13390 explicitly prohibits — its removal is correct. ✅
  • 8ddbcea (docs: document cascading profile activation) — Documentation in maven.mdo accurately describes the implementation: POM-profiles-only guard, property precedence (user → system → cascaded), and fixed-point iteration. ✅
  • d569af2 (test: add negative assertion for profile.pom.condition in project-parent path) — Locks in real behavior: after #13555, getModelProperty() returns null for parent POM properties in the project-parent activation path, so profile.pom.condition correctly does not self-activate. The assertNull assertion is correct and exercises the actual code path. ✅

All prior concerns resolved. LGTM.

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

@gnodet
gnodet merged commit 9e7a17e into apache:master Oct 21, 2026
22 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@gnodet gnodet added the enhancement New feature or request label Oct 21, 2026
gnodet added a commit to gnodet/maven that referenced this pull request Oct 22, 2026
…es it

Commit 651d7a5 (in this branch) restored model.withProperties(interpolationProperties)
in start(Map) so that POM-property conditions could fire in project-parent paths.

This is now incorrect: PR apache#1774 (Cascading profile activation, commit 9e7a17e)
landed in master and provides the proper mechanism: POM properties from activated
profiles flow through getCascadedProfileProperty(), not getModelProperty().

The cascading PR also updated testResolvedDependencyParentCacheDoesNotShareActivationWithProjectParent
to assert that profile.pom.condition must NOT self-activate even in the project-parent
path (assertNull at line 381-383), which conflicts with what 651d7a5 introduced.

Revert start(Map) to pass the original model (not model.withProperties(...)).
Path interpolation is unaffected — interpolationProperties is still passed separately
and used exclusively inside interpolate() for placeholder resolution (see apache#10375).
The fix for apache#13390 remains intact.
@gnodet
gnodet deleted the cascading-profile-activation branch October 26, 2026 07:32
gnodet added a commit that referenced this pull request Nov 19, 2026
…14069)

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

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 #1774) not backported;
  cascading-specific tests disabled with @disabled

Cherry-picked from b0da053

* Address review: remove dead isFromPom() wrappers, fix @SInCE tag

* fix: remove trailing blank lines (Spotless)

* fix: schema codeSegment blocks - 4.0.0/4.0.99 keeps getSource/setSource, 4.1.0+ has clean toString only

---------

Co-authored-by: Guillaume Nodet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MNG-3309] Cascading profile activation

4 participants