e6a created MPMD-325:
------------------------

             Summary: Could not find class due to IncompatibleClassChangeError 
warning
                 Key: MPMD-325
                 URL: https://issues.apache.org/jira/browse/MPMD-325
             Project: Maven PMD Plugin
          Issue Type: Bug
          Components: PMD
    Affects Versions: 3.15.0
         Environment: - maven-pmd-plugin: 3.15.0
- OpenJDK 8, 11, 16
- Maven 3.8.1
            Reporter: e6a


After upgrading to {{maven-pmd-plugin 3.15}}, the analysis shows a _"Could not 
find class [...]"_ warning for each scanned file. Earlier versions up to 3.14 
(= pmd 6.29.0) aren't affected.
h3. Exception Stacktrace:
{noformat}
[INFO] PMD version: 6.38.0
[WARNING] Could not find class <PROJECT CLASS>, due to: 
java.lang.IncompatibleClassChangeError: class 
net.sourceforge.pmd.lang.java.typeresolution.visitors.PMDASMVisitor has 
interface org.objectweb.asm.ClassVisitor as super class
{noformat}
The warning message appears for each class in the project.
h3. Code Sample demonstrating the issue:
{code:xml}
<!-- pom.xml -->
[...]
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.15.0</version>
                <configuration>
                    <linkXRef>false</linkXRef>
                </configuration>
            </plugin>
        </plugins>
    </build>
[...]
{code}
h3. Steps to reproduce:
 # Setup a Maven project with maven-pmd-plugin 3.15.0 with something to analyse
 # mvn clean verify pmd:pmd
 # The mentioned warning appears

h3. Workaround:

Add dependency to org.ow2.asm for the pmd plugin:
{code:xml}
<dependency>
    <groupId>org.ow2.asm</groupId>
    <artifactId>asm</artifactId>
    <version>9.2</version>
</dependency>
{code}
----
_[Original issue|https://github.com/pmd/pmd/issues/3502] reported to the [pmd 
project|https://pmd.github.io/]._



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to