Skip to content

[MNG-8708] Backport parent inference fix to maven-4.0.x - #13010

Merged
gnodet merged 3 commits into
maven-4.0.xfrom
backport/12703-to-maven-4.0.x
Sep 2, 2026
Merged

[MNG-8708] Backport parent inference fix to maven-4.0.x#13010
gnodet merged 3 commits into
maven-4.0.xfrom
backport/12703-to-maven-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #12703 to maven-4.0.x (targeting 4.0.0-rc-7).

  • Cherry-picked both commits from the original PR
  • Resolved conflict: dropped the mixin validation alignment (mixins are a 4.2.0/master-only feature, not present on 4.0.x)
  • All other changes apply cleanly: inferParentVersion, location-based parent validator check, defensive comment, and three-level integration test

Changes

  • DefaultModelBuilder: adds inferParentVersion() to infer missing parent version from reactor models, with defensive comment on grandparent fallback
  • DefaultModelValidator: switches parent relativePath warning from value-based to location-based check, preventing false positives when coordinates are inferred via relativePath resolution
  • Integration tests: path-only, gav-only, explicit-both, and three-level (grandparent → versionless parent → child) scenarios

Test plan

  • maven-impl unit tests: 571 passed, 0 failures
  • CI verification

🤖 Generated with Claude Code

goutamadwant and others added 2 commits September 2, 2026 08:53
Distinguish explicitly declared parent coordinates from values inferred through relativePath. Infer an omitted parent version from the matching reactor model before raw-model validation.

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
- Align mixin validation to use location-based check consistent with
  the parent validation change
- Add defensive comment in inferParentVersion for the grandparent
  version fallback path
- Add three-level integration test (grandparent → versionless parent →
  child) to exercise the version inheritance fallback in
  inferParentVersion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added this to the 4.0.0-rc-7 milestone Sep 2, 2026
@gnodet gnodet added the bug Something isn't working label Sep 2, 2026
The IT framework on maven-4.0.x uses File-based API (extractResources
returns File, newVerifier takes String) and requires a version range
constructor, unlike master's Path-based API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet self-assigned this Sep 2, 2026
@gnodet
gnodet merged commit aa90b44 into maven-4.0.x Sep 2, 2026
23 checks passed
@gnodet
gnodet deleted the backport/12703-to-maven-4.0.x branch September 2, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants