Uploaded image for project: 'Maven PMD Plugin'
  1. Maven PMD Plugin
  2. MPMD-325

Could not find class due to IncompatibleClassChangeError warning

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.15.0
    • 3.16.0
    • PMD
    • None
    • - maven-pmd-plugin: 3.15.0 (PMD 6.38.0)
      - OpenJDK 8, 11, 16
      - Maven 3.8.1 / 3.8.2

    Description

      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.

      Exception Stacktrace:

      [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
      

      The warning message appears for each class in the project.

      Code Sample demonstrating the issue:

      <!-- 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>
      [...]
      

      Steps to reproduce:

      1. Setup a Maven project with maven-pmd-plugin 3.15.0 with something to analyse
      2. mvn clean verify pmd:pmd
      3. The mentioned warning appears

      Workaround:

      Add dependency to org.ow2.asm for the pmd plugin:

      <dependency>
          <groupId>org.ow2.asm</groupId>
          <artifactId>asm</artifactId>
          <version>9.2</version>
      </dependency>
      

      Original issue reported to the pmd project.

      Attachments

        Issue Links

          Activity

            People

              adangel Andreas Dangel
              e6a e6a
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: