Frequently Asked Questions
- Is there an easy way to generate the aggregate report?
-
Yes! Use the
spotbugs:spotbugs-aggregategoal to generate an aggregate SpotBugs report for multi-module projects.First, run
spotbugs:spotbugson each module (e.g. viamvn compile spotbugs:spotbugs), then runmvn spotbugs:spotbugs-aggregatefrom the root of your multi-module project. The aggregate goal collects the SpotBugs XML results from each module and combines them into a single HTML report at the root level.Alternatively, add the
spotbugs-aggregategoal to the<reporting>section of the root POM and runmvn siteafter compiling all modules. - How do I avoid OutOfMemory errors?
-
When running SpotBugs on a project, the default Maven JVM heap size might not be enough to complete the build. The SpotBugs Maven Plugin runs SpotBugs in a separate process, so the memory available to SpotBugs is controlled by the JVM used to launch that process.
You can increase the heap size using the maxHeap option. For example:
<maxHeap>1024</maxHeap>Alternatively, you can increase the heap available to Maven itself using
MAVEN_OPTS, for example:export MAVEN_OPTS=-Xmx1024M - How do I avoid groovy module conflicts when using groovy along with this plugin?
-
If using groovy with same group id (org.codehaus.groovy 3.x or before or org.apache.groovy 4.x or above), an error may occur if not on same version. To alleviate that, make sure groovy artifacts are defined in dependency management in order to force the loaded version correctly on your usage.
