Fixes #1492 [CLI] IncompatibleClassChangeError when running PMD

Use the maven shade plugin to create a modified apex-jorje uber jar,
which has the old asm dependency shaded into a different package,
so that it won't collide with asm 5.
This commit is contained in:
Andreas Dangel 2016-06-04 20:50:19 +02:00
parent 2e9b73141e
commit af21dd5297
5 changed files with 48 additions and 0 deletions

View File

@ -63,6 +63,38 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>apex</include>
</includes>
<excludes>
<exclude>${project.groupId}</exclude>
</excludes>
</artifactSet>
<relocations>
<!-- apex uses an older version of asm, hence we need to shaded it away -->
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>shaded.org.objectweb.asm</shadedPattern>
</relocation>
</relocations>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>apex-jorje-shaded</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -162,6 +162,12 @@
<artifactId>pmd-apex</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-apex</artifactId>
<version>${project.version}</version>
<classifier>apex-jorje-shaded</classifier>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-ui</artifactId>

View File

@ -52,6 +52,10 @@
<directoryMode>0755</directoryMode>
<fileMode>0644</fileMode>
<useProjectArtifact>false</useProjectArtifact>
<!-- exclude the apex (transitive) dependencies - we use the shaded version instead -->
<excludes>
<exclude>apex:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>

View File

@ -376,6 +376,11 @@
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>

View File

@ -152,6 +152,7 @@ you'll need a java8 runtime environment.
* [#1485](https://sourceforge.net/p/pmd/bugs/1485/): Analysis of some apex classes cause a stackoverflow error
* [#1488](https://sourceforge.net/p/pmd/bugs/1488/): [Apex module] Windows line endings falsify the location of issues
* [#1491](https://sourceforge.net/p/pmd/bugs/1491/): Code Climate JSON - corrupt output with real line breaks
* [#1492](https://sourceforge.net/p/pmd/bugs/1492/): [CLI] IncompatibleClassChangeError when running PMD
**API Changes:**