I am using maven-shade-plugin to create a project. However, I have a problem that I could not handle. There are two jars that have the same class, and the path is the same, aspectjweaver.jar and aspectjrt. jar, when the package is jar, I get the warning "duplicate class exists in ....". I tried using the "relocation" property to move the class, but the question is, how can I recounnize a class in two jars? Next is part of my Pom.xml. org.apache.maven.plugins Maven-shadow-plugin 1.3.1
<executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <filters> <filter> <artifact>org.aspectj:aspectjrt</artifact> <includes> <include>*</include> </includes> </filter> </filters> <relocations> <relocation> <pattern>org.aspectj</pattern> <shadedPattern>hide.org.aspectj</shadedPattern> </relocation> </relocations> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>cm.data.DatBoostrap</mainClass> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.handlers</resource> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.schemas</resource> </transformer> </transformers> </configuration> </execution> </executions> </plugin>
source share