Findbugs issue with ant

前端 未结 1 760
悲&欢浪女
悲&欢浪女 2021-01-21 05:09

findbugs:

[findbugs] Executing findbugs from ant task
[findbugs] Running FindBugs...
[findbugs] java.lang.NoClassDefFoundError: org/apache/bcel/classfile/ClassFo         


        
相关标签:
1条回答
  • 2021-01-21 05:47

    The findbugs documentation states the following:

    Note

    It is strongly recommended that you use the Ant task with the version of FindBugs it was included with. We do not guarantee that the Ant task Jar file will work with any version of FindBugs other than the one it was included with.

    You do not indicate which version of the ANT task you are using....

    I would recommend using a dependency manager like ivy to take care of complex classpaths as follows:

    <project name="demo" default="findbugs" xmlns:ivy="antlib:org.apache.ivy.ant">
    
        <target name="init" description="Use ivy to manage ANT tasks">
            <ivy:cachepath pathid="findbugs.path">
                <dependency org="com.google.code.findbugs" name="findbugs-ant" rev="2.0.1" conf="default"/>
            </ivy:cachepath>
    
            <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.path"/>
        </target>
    
        <target name="findbugs" depends="init">
            ..
            <findbugs ..
            ..
        </target>
    
    </project>
    

    Finally, it is also worth considering the use of Sonar. The Sonar ANT task manages all the findbugs dependencies for you and also runs other tools like checkstyle and PMD.

    0 讨论(0)
提交回复
热议问题