【发布时间】:2016-11-24 11:46:39
【问题描述】:
我的目标是让我的项目的 jenkins 构建失败,以防 FindBugs 插件报告错误。为此,我在项目的 pom.xml 中集成了 FindBugs 配置,配置的执行部分如下
<executions>
<execution>
<id>analyze-compile</id>
<phase>compile</phase>
<goals><goal>check</goal></goals>
<configuration>
<threshold>High</threshold>
</configuration>
</execution>
</executions>
我从在线资源中找到了上述配置,并且使用此配置,项目不会因 FindBugs 报告的错误而失败。我也尝试过其他配置,如下所示
<xmlOutput>true</xmlOutput>
<configuration>
<failOnError>${findbugs.failOnError}</failOnError>
<threshold>High</threshold>
</configuration>
<executions>
<execution>
<id>noFailOnError</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<failOnError>false</failOnError>
</configuration>
</execution>
<execution>
<id>failOnError</id>
<phase>install</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
有人可以告诉我在 FindBugs 中出现错误的情况下需要用于失败构建的正确执行是什么?
【问题讨论】:
标签: maven jenkins pom.xml findbugs