Skip to content

[3.10.x] Fix #13390: stop POM properties from self-activating profiles in external builds - #13451

Merged
gnodet merged 1 commit into
apache:maven-3.10.xfrom
gnodet:fix/13390-maven-3.10.x
Oct 15, 2026
Merged

gnodet merged 1 commit into
apache:maven-3.10.xfrom
gnodet:fix/13390-maven-3.10.x

Conversation

@gnodet

@gnodet gnodet commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Backport of #13450 to maven-3.10.x.

Changes

Test plan

  • ResolvedDependencyProfileActivationTest — 12 tests pass
  • Integration test with jruby-base-9.4.2.0 dependency (manual verification)

…ctivation sandbox

A dependency POM's own <properties> must not activate its property-based
profiles. The externalActivationContext() sandbox was merging model
properties into the system-property lookup, causing POMs like jruby-base
to self-activate profiles unintentionally.

Remove the merge — only system properties and negated-property checks
drive profile activation in external builds, restoring 3.9.x semantics.
This does not affect apache#13084 (RESTEasy), which uses a negated-property
profile (!resteasy.dependencies.eap) that works correctly without the merge.

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.

LGTM. Correct fix with well-validated tests.

Pre-fix validation: Ran testExternalModelPomPropertyDoesNotSelfActivateProfile and testExternalModelPomDeclaredPropertyActivationIsSuppressed against the pre-fix state (DefaultModelBuilder with the merging logic restored, tests kept): both fail as expected (property self-activates the profile). With the fix applied, all 12 tests in ResolvedDependencyProfileActivationTest pass, including the new ones and the existing RESTEasy negated-property test.

The fix is minimal and correct: removing the project-properties merge from externalActivationContext() restores 3.9.x semantics without affecting negated-property profiles (!foo), which work correctly because the absent property evaluates to true regardless.

The three new tests cover the right scenarios:

  • testExternalModelPomPropertyDoesNotSelfActivateProfile — the jruby-base regression (#13390)
  • testExternalModelPomDeclaredPropertyActivationIsSuppressed — updates the existing positive-activation test to the new expected behavior
  • testExternalModelNegatedPropertyProfileFires — confirms the RESTEasy pattern (#13084) still works

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

@gnodet gnodet added bug Something isn't working backport mvn3 labels Oct 14, 2026
@gnodet gnodet added this to the 3.10.1 milestone Oct 15, 2026
@gnodet gnodet added the java Pull requests that update Java code label Oct 15, 2026
@gnodet
gnodet merged commit 6a31399 into apache:maven-3.10.x Oct 15, 2026
14 checks passed
@gnodet
gnodet deleted the fix/13390-maven-3.10.x branch October 26, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working java Pull requests that update Java code mvn3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants