maven icon indicating copy to clipboard operation
maven copied to clipboard

mvnup 4.0.0-rc-5 introduces invalid when upgrading to model 4.1.0

Open Jayesh45-master opened this issue 11 months ago • 2 comments

Affected version

4.0.0-rc-5

Bug description

I ran mvnup apply --model-version 4.1.0 using Maven Upgrade Tool 4.0.0-rc-5 on the apache/httpcomponents-client repository.

After the upgrade, running mvn clean verify fails with a parent POM cycle error. The resulting POM hierarchy becomes invalid and Maven refuses to build.

This issue appears to be introduced by the model upgrade process and was not present before running mvnup.

steps to reproduce

  1. Clone apache/httpcomponents-client
  2. Checkout commit ee6ebee18
  3. Run: mvnup apply --model-version 4.1.0
  4. Run: mvn clean verify

reults The build fails with multiple errors like:

The parents form a cycle: httpclient5-parent -> pom.xml -> httpcomponents-parent -> pom.xml -> httpcomponents-parent

Maven is unable to resolve the project due to a cyclic parent relationship.

expected result The upgraded project should build successfully after applying mvnup, or mvnup should avoid producing an invalid POM structure with cyclic parents.

additional context

  • The issue does not occur before running mvnup.
  • Removing mvnup-generated changes restores a successful build.
  • This seems related to how parent POMs or project roots are rewritten during the modelVersion 4.1.0 upgrade.

Jayesh45-master avatar Dec 29 '25 19:12 Jayesh45-master

Related mvnup fixes merged since RC-5 (#12158, #12205) improved parent chain resolution and CI-friendly version handling. However, none of the ~20 merged PRs explicitly address parent cycle introduction.

This may still be open — the fixes for property resolution in parent chains may not be sufficient to prevent mvnup from rewriting the parent structure into a cycle.

Could you verify by running current mvnup apply --model-version 4.1.0 on httpcomponents-client at commit ee6ebee18? If the parent cycle no longer occurs, this can be closed.

gnodet avatar Jun 23 '26 09:06 gnodet

Verified fixed on current master (4.0.0-SNAPSHOT). Running mvnup apply --model-version 4.1.0 on httpcomponents-client at commit ee6ebee18 no longer produces a parent POM cycle — mvn help:effective-pom -N succeeds cleanly.

Fixed by the batch of mvnup parent resolution fixes, likely #12158 (effective model for remote parents) and #12205 (CI-friendly parent versions).

gnodet avatar Jun 23 '26 10:06 gnodet