Skip to content

[3.10.x] Fix dependency POM property profile activation - #13402

Open
Utkarsh-rwt wants to merge 1 commit into
apache:maven-3.10.xfrom
Utkarsh-rwt:backport/13390-maven-3.10.x
Open

Utkarsh-rwt wants to merge 1 commit into
apache:maven-3.10.xfrom
Utkarsh-rwt:backport/13390-maven-3.10.x

Conversation

@Utkarsh-rwt

@Utkarsh-rwt Utkarsh-rwt commented Oct 11, 2026 •

Copy link
Copy Markdown

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

  • Stop merging dependency POM-local properties into external system properties.
  • Preserve system-property, JDK, OS, and negated-property/default-on activation behavior.
  • Continue suppressing consumer user properties for dependency POM profile activation.
  • Update the 3.10.x compat regression test to assert that POM-local properties do not activate profiles.

Validation

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>
@github-actions

This comment has been minimized.

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

@Utkarsh-rwt

Copy link
Copy Markdown
Author

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.

@Utkarsh-rwt

Copy link
Copy Markdown
Author

@gnodet

@gnodet

gnodet commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

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 (!resteasy.dependencies.eap), not a positive POM-property activation — so removing the POM-property merge does not break it.

Replacement PRs with a complete fix, tests, and updated Javadoc have been submitted:

@Utkarsh-rwt
Utkarsh-rwt requested a review from gnodet October 13, 2026 11:16
@gnodet gnodet added bug Something isn't working backport mvn3 labels Oct 14, 2026
@cstamas cstamas modified the milestone: 3.10.1 Oct 20, 2026
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 mvn3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants