You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/05/18 07:46:31 UTC

[I] maven-shade-plugin dependency-reduced-pom.xml causes parent cycle error in Maven 4 [maven]

gnodet opened a new issue, #12074:
URL: https://github.com/apache/maven/issues/12074

   ## Summary
   
   The `maven-shade-plugin` generates a `dependency-reduced-pom.xml` that Maven 4's stricter model validator detects as a parent cycle. This works fine in Maven 3.
   
   ## Reproduction
   
   Build any project using `maven-shade-plugin` with a parent POM, e.g., [apache/maven-doxia-converter](https://github.com/apache/maven-doxia-converter):
   
   ```
   mvn package -DskipTests
   ```
   
   ### Expected
   Build succeeds (as it does with Maven 3).
   
   ### Actual
   ```
   [ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.6.0:shade (default) 
     on project doxia-converter: Error creating shaded jar: 1 problem was for [inherited]:doxia-converter:jar:1.4-SNAPSHOT
       - [FATAL] The parents form a cycle: org.apache.maven.doxia:doxia-tools:43 -> 
         /home/runner/work/maven4-testing/maven4-testing/project/pom.xml -> 
         org.apache.maven.doxia:doxia-tools:43 
         for project [inherited]:doxia-converter:jar:1.4-SNAPSHOT 
         at /home/runner/work/maven4-testing/maven4-testing/project/dependency-reduced-pom.xml
   ```
   
   ## Root Cause
   
   The shade plugin writes `dependency-reduced-pom.xml` which references the parent POM by file path. Maven 4's model builder resolves this path and detects a cycle: the parent POM resolves back to the project itself. Maven 3 was lenient about this during the shade plugin's internal POM re-reading.
   
   ## Affected projects
   
   From maven4-testing across ~960 Apache repositories:
   - maven-doxia-converter (shade 3.6.0)
   - sling-launchpad-comparator (shade 3.6.0)
   - sling-org-apache-sling-models-impl (shade 3.6.1)
   
   All use recent shade plugin versions (3.6.x), so this is not about outdated plugins.
   
   ## Environment
   
   - Maven: 4.0.0-SNAPSHOT (branch `maven-4.0.x-test-fixes`)
   - maven-shade-plugin: 3.6.0 / 3.6.1
   - Java: 17.0.18 (Eclipse Adoptium)
   
   Test results: https://github.com/gnodet/maven4-testing/issues/9934
   
   _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: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] maven-shade-plugin dependency-reduced-pom.xml causes parent cycle error in Maven 4 [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed issue #12074: maven-shade-plugin dependency-reduced-pom.xml causes parent cycle error in Maven 4
URL: https://github.com/apache/maven/issues/12074


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org