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

   ## Summary
   
   `maven-shade-plugin` generates a `dependency-reduced-pom.xml` with 
`<relativePath>pom.xml</relativePath>` in the parent section. When Maven 4 
processes this generated POM (e.g. during the shade goal itself or downstream 
artifact resolution), it evaluates the relativePath, finds it resolves to the 
same project (not the declared parent), and raises a `[FATAL]` error.
   
   Maven 3 was lenient in this case (WARNING-level or ignored).
   
   ## Reproduction
   
   Affected project (found in maven4-testing rc-6 run):
   - 
[sling-org-apache-sling-models-impl](https://github.com/gnodet/maven4-testing/issues/39737)
 — uses `maven-shade-plugin:3.6.1`
   
   ## Error
   
   ```
   [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-shade-plugin:3.6.1:shade (default)
           on project org.apache.sling.models.impl: Error creating shaded jar:
           Encountered 1 problem(s) while processing the POMs:
   [ERROR]     - [FATAL] 'parent.relativePath' of POM 
org.apache.sling:org.apache.sling.models.impl:2.0.3-SNAPSHOT
           (/home/runner/work/.../dependency-reduced-pom.xml) points at 
'pom.xml' which resolves to
           org.apache.sling:org.apache.sling.models.impl instead of the 
declared parent
           org.apache.sling:sling-bundle-parent. Correct the <relativePath> 
value or remove it to let
           Maven resolve the parent from the repository.
   ```
   
   ## Root cause
   
   The `dependency-reduced-pom.xml` generated by maven-shade-plugin contains:
   ```xml
   <parent>
     ...
     <relativePath>pom.xml</relativePath>
   </parent>
   ```
   
   This is a generated synthetic POM — the relativePath is left over from the 
original POM transformation. Maven 4's parent POM resolution is stricter: when 
`relativePath` resolves to the project itself (same groupId:artifactId), it is 
now a `[FATAL]` error instead of a warning.
   
   ## Expected behavior
   
   Either:
   1. `maven-shade-plugin` should strip or fix the `<relativePath>` in the 
generated `dependency-reduced-pom.xml`, OR
   2. Maven 4 should apply WARNING (not FATAL) severity when a 
generated/synthetic POM has an incorrect `relativePath`, similar to Maven 3 
behavior.
   
   ## Maven version
   
   Maven 4.0.0-rc-6 / maven-4.0.x branch
   


-- 
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