You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andreas Dangel (Jira)" <ji...@apache.org> on 2021/09/30 13:43:00 UTC

[jira] [Commented] (MPMD-325) Could not find class due to IncompatibleClassChangeError warning

    [ https://issues.apache.org/jira/browse/MPMD-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17422795#comment-17422795 ] 

Andreas Dangel commented on MPMD-325:
-------------------------------------

Fixed by MPMD-326, verified by additional tests in https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=commit;h=befd3240e9a479cd0be45cac87bcf2b2e8c977ac

> 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 (PMD 6.38.0)
> - OpenJDK 8, 11, 16
> - Maven 3.8.1 / 3.8.2
>            Reporter: e6a
>            Assignee: Andreas Dangel
>            Priority: Major
>             Fix For: 3.16.0
>
>
> 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)