FindBugs的蚂蚁脚本不接受bcel.jar [英] FindBugs not accepting bcel.jar in ANT script
问题描述
我的FindBugs安装到我的蚂蚁lib目录下,并添加以下code到我的主要ANT脚本:
I installed findbugs into my ant lib directory and added the following code into my main ANT script:
<target name="findbugs" depends="init">
<findbugs home="C:\\findbugs\\" output="html outputFile="C:\\findbugs\\out.html" jvmargs="-Xms512M">
<sourcePath path="${messageaggregator.src}" />
<class location="${messageaggregator.src}"/>
</findbugs>
</target>
下面的XML是init目标中调用:
The following xml is called within the init target:
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
在运行Ant脚本,我得到的是以下的输出:
On running the ANT script, all I get is the following output:
findbugs:
[findbugs] Executing findbugs from ant task
[findbugs] Running FindBugs...
[findbugs] BCEL class compatability error.
[findbugs] The version of class org.apache.bcel.generic.ObjectType found was not compatible with
[findbugs] FindBugs. Please remove any BCEL libraries that may be interfering. This may happen
[findbugs] if you have an old version of BCEL or a library that includes an old version of BCEL
[findbugs] in an "endorsed" directory.
[findbugs] Output saved to C:\\findbugs\\out.html
为什么FindBugs的不工作?
Why is findbugs not working?
推荐答案
您已经有了使用旧版本的BCEL,你必须摆脱的冲突。这可能是你的jre / lib / ext目录(坏主意),或者你已经为自己的项目,或蚂蚁/ lib中的一部分可能在CLASSPATH的一部分。在任何情况下,你会发现所有的BCEL JAR文件在CLASSPATH中,将其删除,并与版本更新他们FindBugs的要求。
You've got a conflict with an older version of BCEL that you have to get rid of. It might be in your jre/lib/ext directory (bad idea), or part of the CLASSPATH that you've got for your project, or maybe part of the Ant /lib. In any case, you should find all the BCEL JARs in your CLASSPATH, remove them, and update them with the version that FindBugs requires.
这篇关于FindBugs的蚂蚁脚本不接受bcel.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!