I use the maven-shade-plugin to build a project , However, I have encounter a problem I could not handle it.there are two jars almost have the same class and the path is same,aspectjweaver.jar and aspectjrt.jar , when package the jar ,I get the warning "duplicate class have exist in ....". I tried to use the "relocation" property to relocate the class, but the question is , How can I recongnize the class in the two jars? Next is part of my Pom.xml. org.apache.maven.plugins maven-shade-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>