Fix Maven 4 parent inference
Corrected Maven's file-to-raw model transformation so partially omitted parent coordinates resolve consistently inside multi-module reactor builds.
apache/maven · #12703
Reactor correctness fix
Maven 4.1 can now infer omitted parent versions from matching reactor models without emitting false relative-path warnings.
Problem
A child POM with a relative parent and an omitted version could fail raw-model validation before Maven had inferred the matching reactor parent's version. Values inherited from the relative POM could also trigger a warning intended only for explicitly combined coordinates and `relativePath`.
Approach
Infers a missing parent version from the matching reactor model before raw validation, preserves the inferred value's source location, and bases the warning on whether `groupId` or `artifactId` was explicitly declared rather than merely inferred.
Impact and scope
- Restores supported partial parent declarations in Maven 4.1 multi-module builds.
- Preserves actionable warnings for explicitly combined coordinates while eliminating false warnings for inferred values.
- Handles nested three-level reactors and source-location reporting consistently across model transformation and validation.
Validation
- Added dedicated Core IT coverage for supported, explicit-both, and three-level parent-inference scenarios.
- Passed focused integration tests, 550 Maven implementation tests, repository verification, and the final multi-OS/JDK build and integration matrix.
- The authored implementation and GitHub-verified merge credit Goutam Adwant; repeated maintainer approvals closed MNG-8708.