Repository navigation
[3.10.x] Fix #13390: stop POM properties from self-activating profiles in external builds - #13451
Conversation
…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
left a comment
There was a problem hiding this comment.
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 behaviortestExternalModelNegatedPropertyProfileFires— confirms the RESTEasy pattern (#13084) still works
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Summary
Backport of #13450 to
maven-3.10.x.<properties>must not activate its property-based profilesexternalActivationContext()sandbox was merging model properties into the system-property lookup, causing POMs like jruby-base to self-activate profiles unintentionally (Maven 3.10.0 activates dependency POM profiles using the POM’s own properties #13390)!resteasy.dependencies.eap) that works correctly without the mergeChanges
DefaultModelBuilder.externalActivationContext(): remove POM-property merge from sandboxPropertyProfileActivator: update commentsProfileActivationContext: updategetProjectProperties()JavadocResolvedDependencyProfileActivationTest: flip POM-property test to assert suppression, add jruby-style (Maven 3.10.0 activates dependency POM profiles using the POM’s own properties #13390) and resteasy-style (3.10.x fails on org.jboss.resteasy:resteasy-client:jar:7.0.0.Final #13084) regression testsTest plan
ResolvedDependencyProfileActivationTest— 12 tests pass