Violation Checking
The spotbugs:check
goal allows you to configure your build to fail if any errors are found in the SpotBugs report.
The following code fragment enables the check in a build during the verify
phase. The check will fail if any of the filter triggers in the include file are met.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> ... <build> <plugins> <plugin> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> <version>4.8.6.6</version> <configuration> <effort>Max</effort> <threshold>Low</threshold> <xmlOutput>true</xmlOutput> </configuration> <executions> <execution> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> </plugins> </build> ... </project>