12

我设法在我的 maven 构建过程中运行 findbugs,并且我还在 eclipse 中配置了 findbugs。但是,当在 Eclipse 和 Maven 中运行时,我会遇到不同的错误,而且我似乎无法找到一个设置,其中错误的数量与 Eclipse 和 Maven 中的匹配。

我的 Maven 设置是这样的:

<version>2.5.2</version>
<configuration>
        <failOnError>false</failOnError>
        <threshold>Normal</threshold>
        <effort>Default</effort>
        <xmlOutput>true</xmlOutput>
        <findbugsXmlOutput>true</findbugsXmlOutput>
        <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
</configuration>

在 Eclipse 中,我有:

Findbugs Version: 2.0.1
Analysis Effort: Default
Minimum Rank to report: 20
Minimum Confidence to Report: Medium
Reported categories: All

使用这些设置,我在 Eclipse 中遇到了更多错误。我的主要问题是,我什至无法匹配 maven 和 eclipse 之间的不同设置。

4

2 回答 2

1

您可以尝试使用m2e-code-quality,其中包括一个 m2eclipse“连接器”,它应该确保您的 Eclipse FindBugs 配置与您的 pom.xml 中指定的配置相匹配。

于 2012-10-30T10:38:42.233 回答
1

我有完全相同的问题。Eclipse(使用 FindBugs 2.0.1)和 Maven 插件(2.5.2 版)中可用的设置不匹配。Maven 插件中缺少的一项设置是“信心”。使用另一个软件来匹配配置并不能解决问题,因为 Eclipse 匹配只是突出了一个问题。我希望完全独立于 Eclipse 的 Maven 构建报告的某些错误没有被报告。碰巧可以在 Eclipse 中报告它们。

于 2012-10-30T13:22:16.847 回答