Repository navigation
[3.10.x] Fix dependency POM property profile activation - #13402
Utkarsh-rwt wants to merge 1 commit into
Conversation
Prevent dependency POM-local properties from activating their own external profiles and update the regression test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
gnodet
left a comment
There was a problem hiding this comment.
LGTM. Mechanically correct fix: removing the getSystemProperties() merge of POM-declared properties means PropertyProfileActivator (which only consults user + system properties) can no longer see POM-local properties in external model builds. No residual leak path — no activator calls getProjectProperties() directly. The test rename and assertion inversion correctly validate the new behavior, and the static trace confirms the old assertEquals("activated", ...) would fail with the new code.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
After reviewing #13084/#13112/#13114, I believe the #13390 change should not be retained as currently implemented. The external-model sandbox intentionally exposes dependency POM properties because they are part of the published model and are required for profiles such as RESTEasy’s defaults and BOM/dependency-management profiles. Removing that lookup or returning null from getModelProperty() would regress the behavior fixed by #13084. I will withdraw the Maven 3.10.x backport and revert the #13390 changes unless maintainers confirm that the documented behavior should supersede the established #13084 design. |
|
Fully automatic review from Claude Code @Utkarsh-rwt Your instinct in the comment above was right to question the approach, but the concern about regressing #13084 turns out to be unfounded. The actual RESTEasy profile that motivated #13084 uses a negated-property pattern ( Replacement PRs with a complete fix, tests, and updated Javadoc have been submitted:
|
Summary
Backport of the #13390 fix for Maven 3.10.x.
Dependency POM-local properties must not activate property-based profiles in the same POM during external model building. Maven 3.10.x currently merges POM properties into the external profile activation system-property lookup, which causes unintended profile activation.
Changes
Validation
mvn -pl maven-model-builder -Dtest=ResolvedDependencyProfileActivationTest -Dsurefire.failIfNoSpecifiedTests=false testResult: 10 tests passed, 0 failures, 0 errors.
I hereby declare that I have filed an Apache Individual Contributor License Agreement.
I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004