maven findBugs

        <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.png

对于查找范围控制更方便,findBugs也有自带的可视化界面,没插件方便

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容