If you’re a Maven user, automatically generating external issues reports is easy:
-
Open your pom.xml and in the section add the following plugins:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version> 3.10 . 0 </version> </plugin> <plugin> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> <version> 3.1 . 1 </version> <configuration> <effort>Max</effort> <threshold>Low</threshold> <failOnError> true </failOnError> <includeFilterFile>${session.executionRootDirectory}/spotbugs-include.xml</includeFilterFile> <plugins> <plugin> <groupId>com.h3xstream.findsecbugs</groupId> <artifactId>findsecbugs-plugin</artifactId> <version>LATEST</version> <!-- Auto-update to the latest stable --> </plugin> </plugins> </configuration> </plugin>
-
Add or update the section with:
<properties> <sonar.java.spotbugs.reportPaths>./target/spotbugsXml.xml</sonar.java.spotbugs.reportPaths> <sonar.java.pmd.reportPaths>./target/pmd.xml</sonar.java.pmd.reportPaths>` <sonar.java.checkstyle.reportPaths>./target/checkstyle-result.xml</sonar.java.checkstyle.reportPaths> </properties>
-
Execute:
mvn clean package spotbugs:spotbugs pmd:pmd checkstyle:checkstyle sonar:sonar