<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
<configuration>
<!-- 设置分析工作的等级,可以为Min、Default和Max -->
<effort>Default</effort>
<!--bug等级Low、Medium和High-->
<threshold>High</threshold>
<!--发现错误则中断构建-->
<failOnError>true</failOnError>
<includeTests>false</includeTests>
<XmlOutput>true</XmlOutput>
</configuration>
<executions>
<execution>
<id>findbugs</id>
<phase>package</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
推荐使用IDEA findbugs插件
对于查找范围控制更方便,findBugs也有自带的可视化界面,没插件方便