【发布时间】:2011-09-17 17:48:12
【问题描述】:
我之前使用过 FindBugs 并且没有遇到任何问题,但是这次在 Ubuntu Natty Narval 上的 Eclipse Helios 上发现了但未显示的错误。
这是我尝试过的:
- 右键项目>查找Bugs>查找Bugs
- 看进度发现发现了3个bug
- 在“问题”视图中没有列出它们
我尝试通过以下方式进入自己的视角:Open Perspective > Other > FindBugs but Bug Explorer is empty.
有什么想法可以查看这些错误吗?
更新:在 Eclipse 错误日志中我看到:
!ENTRY edu.umd.cs.findbugs.plugin.eclipse 2 2 2011-06-18 21:13:24.968
!MESSAGE The following classes needed for FindBugs analysis on project **
were missing:
!SUBENTRY 1 edu.umd.cs.findbugs.plugin.eclipse 2 0 2011-06-18 21:13:24.969
!MESSAGE org.apache.commons.exec.CommandLine
!SUBENTRY 1 edu.umd.cs.findbugs.plugin.eclipse 2 0 2011-06-18 21:13:24.969
!MESSAGE org.apache.commons.exec.DefaultExecutor
!SUBENTRY 1 edu.umd.cs.findbugs.plugin.eclipse 2 0 2011-06-18 21:13:24.969
!MESSAGE org.apache.commons.exec.ExecuteException
更新 2:我不知道如何修复 Eclipse,但我找到了解决方法。我在 maven 的 pom.xml 中添加了 findbugs 报告
<reporting>
<plugins>
[...]
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.3-SNAPSHOT</version>
<configuration>
<xmlOutput>true</xmlOutput>
<!-- Optional derectory to put findbugs xdoc xml report -->
<xmlOutputDirectory>target/site</xmlOutputDirectory>
</configuration>
</plugin>
</plugins>
</reporting>
以下配置在 target/site/findbugs.html 中生成 HTML 报告
【问题讨论】:
-
您是否尝试过重新构建您的项目?
-
现在试过了,我去掉了“自动构建”、“清理...”和“构建项目”的勾选,再次运行 FindBugs,但还是什么都看不到。