eitan-rosenberg opened a new issue, #13558:
URL: https://github.com/apache/maven/issues/13558

   ### Affected version
   
   4.0.0-rc-7
   
   ### Bug description
   
   I have a project that I wanted to shade some of the dependencies.
   
   Without the use of maven-antrun-plugin 
   
**G:\MyMavenRepo\cookies\made\home\MyJaversCore\1.0.1\MyJaversCore-1.0.1.pom** 
_resembles_ **K:\JavaProjects\MyJaversCore\MyJaversCore\pom.xml** .
   
   This is the first time I use maven-shade-plugin so I might be missing some 
things.
   
   Gemini gave a helping hand....
   
   Any response will be appreciated. 
   
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <project xmlns="http://maven.apache.org/POM/4.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   
        <modelVersion>4.0.0</modelVersion>
   
        <parent>
                <groupId>cookies.made.home</groupId>
                <artifactId>MyMavenParent</artifactId>
                <version>2.0.2</version>
        </parent>
   
        <artifactId>MyJaversCore</artifactId>
        <version>1.0.1</version>
   
        <properties>
                
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                
<maven.compiler.source>${java.specification.version}</maven.compiler.source>
                
<maven.compiler.target>${java.specification.version}</maven.compiler.target>
                <deployment.target>local</deployment.target>
   
        </properties>
   
        <dependencies>
   
                <dependency>
                        <groupId>io.github.classgraph</groupId>
                        <artifactId>classgraph</artifactId>
                        <version>4.8.198</version>
                </dependency>
   
                <dependency>
   
                        <groupId>com.google.code.gson</groupId>
                        <artifactId>gson</artifactId>
                        <version>2.14.0</version>
   
                        <exclusions>
                                <exclusion>
                                        <groupId>*</groupId>
                                        <artifactId>*</artifactId>
                                </exclusion>
                        </exclusions>
   
                </dependency>
   
                <dependency>
   
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                        <version>33.7.2-jre</version>
   
                        <exclusions>
                                <exclusion>
                                        <groupId>*</groupId>
                                        <artifactId>*</artifactId>
                                </exclusion>
                        </exclusions>
   
                </dependency>
   
                <dependency>
                        <groupId>com.google.guava</groupId>
                        <artifactId>failureaccess</artifactId>
                        <version>1.0.3</version>
                </dependency>
   
                <dependency>
                        <groupId>org.javers</groupId>
                        <artifactId>javers-core</artifactId>
                        <version>7.11.9</version>
                </dependency>
   
                <dependency>
                        <groupId>org.javers</groupId>
                        <artifactId>javers-persistence-sql</artifactId>
                        <version>7.11.9</version>
                </dependency>
   
                <dependency>
                        <groupId>org.picocontainer</groupId>
                        <artifactId>picocontainer</artifactId>
                        <version>2.16</version>
                </dependency>
   
                <dependency>
                        <groupId>org.polyjdbc</groupId>
                        <artifactId>polyjdbc</artifactId>
                        <version>0.7.6</version>
                </dependency>
   
                <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                        <version>2.0.20</version>
                </dependency>
   
        </dependencies>
   
        <build>
                <plugins>
   
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-shade-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <phase>package</phase>
                                                <goals>
                                                        <goal>shade</goal>
                                                </goals>
                                                <configuration>
   
                                                        
<shadedArtifactAttached>false</shadedArtifactAttached>                          
                
                                                        
<createDependencyReducedPom>true</createDependencyReducedPom>  
   
                                                        <artifactSet>
                                                                <includes>
   
                                                                        
<include>org.javers</include>
                                                                        
<include>org.picocontainer</include>
                                                                        
<include>org.polyjdbc</include>
   
                                                                </includes>
                                                        </artifactSet>
   
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
   
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-antrun-plugin</artifactId>
                                <version>3.1.0</version>
                                <executions>
                                        <execution>
                                                <id>overwrite-consumer-pom</id>
                                                <phase>install</phase> <!-- 
Triggers right at the end of
                                                the local install -->
                                                <goals>
                                                        <goal>run</goal>
                                                </goals>
                                                <configuration>
                                                        <target>
                                                                <!-- Overwrite 
the broken primary consumer file
                                                                with the 
perfectly reduced build.pom file -->
                                                                <copy
                                                                        
file="G:\MyMavenRepo\cookies\made\home\MyJaversCore\1.0.1\MyJaversCore-1.0.1-build.pom"
                                                                        
tofile="G:\MyMavenRepo\cookies\made\home\MyJaversCore\1.0.1\MyJaversCore-1.0.1.pom"
                                                                        
overwrite="true" />
                                                        </target>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
   
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-jar-plugin</artifactId>
                                <configuration>
                                        <archive>
                                                <manifestEntries>
                                                        <Automatic-Module-Name>
                                                                
cookies.made.home.myJaversCore</Automatic-Module-Name>
                                                </manifestEntries>
                                        </archive>
                                </configuration>
                        </plugin>
   
                </plugins>
        </build>
   
   </project>
   ```
   
   
   
   
   
   
    


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