gnodet opened a new pull request, #12078:
URL: https://github.com/apache/maven/pull/12078

   ## Summary
   
   - Fix false parent cycle detection in Maven 4's model builder when a 
generated POM (e.g., `dependency-reduced-pom.xml` from shade plugin) has a 
parent whose default relative path resolves to a POM with a different GA but 
the same parent reference
   - Move the GA mismatch check before the recursive `readAsParentModel()` call 
by reading the file model first, matching the Maven 3 model builder's behavior
   
   ## Root cause
   
   In `readParentLocally()`, the GA check ran after `readAsParentModel()` which 
recursively resolves the candidate's entire parent chain. When the candidate 
POM shares the same parent reference as the source POM, the recursive 
resolution adds that parent's model ID to the `parentChain` set — and the model 
ID check in `readParent()` detects a false cycle.
   
   ## Test plan
   
   - [x] New unit test `testNoFalseCycleWhenRelativePathResolvesToWrongPom` in 
`ParentCycleDetectionTest`
   - [x] All 4 cycle detection tests pass
   - [x] Full `maven-impl` test suite (463 tests) passes with no regressions
   - [ ] Backport PR for `maven-4.0.x` to follow
   
   Fixes #12074
   
   _Claude Code on behalf of Guillaume Nodet_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to