我使用这个插件运行findbugs和maven,然后构建失败,即使我通过Eclipse运行find bugs,最大设置为20,我也得到0个bug。现在它失败了,有33个。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.0.1</version>
<configuration>
<threshold>Ignore</threshold>
<xmlOutput>true</xmlOutput>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>两个问题:
为什么Eclipse Findbugs插件和Maven Findbugs插件之间会有如此大的差异?
我可以以某种方式让Eclipse Findbugs加载从Maven Findbugs生成的findbugscheck.xml,以便自动突出显示我的代码。浏览xml文件非常烦人。
发布于 2012-01-19 11:17:33
Eclipse Findbugs插件和findbugs-maven-plugin之间的差异可能是因为这两个产品使用了不同版本的Findbugs实用程序。这些产品中的每一个都运行FindBugs实用程序(found here),然后解析该实用程序的输出并显示结果。findbugs-maven-plugin-2.0.1基于Findbugs 1.3.8。我不能说你的Eclipse插件是基于哪个版本的Findbugs。
Findbugs实用程序支持一些可以影响结果的command line options (如-effort:max、-effort:min)。Eclipse Findbugs插件和findbugs-maven-plugin可能会提供不同的命令行选项,从而导致结果不一致。如果它们都提供了这些命令行选项的配置,那么就有可能消除这种差异。
Eclipse Findbugs插件在Eclipse的插件视图中提供了一些结果过滤功能。在插件的视图中可以通过工具栏图标进行过滤(不能百分之百确定这个图标的位置,因为我现在不在开发框中)。
此外,来自Findbugs website
"FindBugs支持插件架构,允许任何人添加新的错误检测器。“
这可能意味着Eclipse插件已经插入了其他错误检测器,但我不知道是这样的,这只是一个需要指出的可能性。我从来没有找到一种方法让Eclipe Findbugs插件从maven版本中加载findbugscheck.xml。
ETA:您可以尝试运行Findbugs GUI并使用它加载和查看结果,而不是手动查看findbugs结果。
https://stackoverflow.com/questions/8914661
复制相似问题