Skip to content

[MNG-8432] Integration test for MNG-8432 using mixins#12461

Open
Hiteshsai007 wants to merge 1 commit into
apache:masterfrom
Hiteshsai007:mixin-properties-integration-test
Open

[MNG-8432] Integration test for MNG-8432 using mixins#12461
Hiteshsai007 wants to merge 1 commit into
apache:masterfrom
Hiteshsai007:mixin-properties-integration-test

Conversation

@Hiteshsai007

@Hiteshsai007 Hiteshsai007 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This PR adds an integration test to demonstrate and document the correct usage of the <mixins> feature (introduced in Maven 4.2.0) as the native and architecturally preferred solution to MNG-8432.

As discussed in the original PR #12417 (which proposed extending <dependency> BOM imports to include properties), inheriting both dependency management and properties from a shared BOM-like module is a highly requested use case (e.g. for Spring Boot, Quarkus). However, extending dependencyManagement imports to pull properties introduces significant risks around property pollution, silent semantic drift, and ordering fragility.

Instead, as @gnodet correctly pointed out, Mixins are the supported mechanism for this use case. Following his suggestion, this integration test (MavenITmng8432MixinsPropertiesTest) explicitly verifies that when a project uses a <mixin>, it successfully inherits both:

  1. dependencyManagement (verified by the consumer being able to resolve the managed dependency)
  2. properties (verified by checking the effective-pom for the inherited property)

This serves as both a regression test for the mixin functionality and as executable documentation for users encountering the MNG-8432 use case.

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

Review — Integration Test for MNG-8432

This PR adds an integration test that verifies mixin-based property and dependency management inheritance, targeting the MNG-8432 scenario. The test follows the established patterns in MavenITmng5102MixinsTest and MavenITmng11133MixinsPrecedenceTest.

Observations

🔵 Low — Partial overlap with existing mixin tests
MavenITmng5102MixinsTest already covers mixin property inheritance. However, this test specifically targets the MNG-8432 scenario (BOM-style mixin with both properties and <dependencyManagement> via GAV resolution), which is a valid regression test for the reported issue.

🔵 Low — String matching on effective POM
The test uses Files.readString() + String.contains() on the effective POM XML. The Maven IT convention typically uses maven-it-plugin-expression with verifier.loadProperties(), which is more robust against whitespace/formatting changes. That said, MavenITmng11133MixinsPrecedenceTest uses the same Files.readString + contains approach, so this is an established alternative pattern.

Summary

Clean integration test that follows existing conventions. The test correctly installs the mixin BOM, then verifies that the consumer project's effective POM includes both the inherited property and the managed dependency. No blocking issues found. ✅


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
New MNG-8432 integration test PR. Verifier caught 8/10 false positives
from reviewer (outdated API assumptions). 2 LOW observations posted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@elharo elharo changed the title Integration test for MNG-8432 using mixins [MNG-8432] Integration test for MNG-8432 using mixins Jul 10, 2026
@Hiteshsai007 Hiteshsai007 requested a review from elharo July 10, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants