Fork me on GitHub

Frequently Asked Questions

  1. Is there an easy way to generate the aggregate report?
  2. How do I avoid OutOfMemory errors?
  3. How do I avoid groovy module conflicts when using groovy along with this plugin?
Is there an easy way to generate the aggregate report?

Yes! Use the spotbugs:spotbugs-aggregate goal to generate an aggregate SpotBugs report for multi-module projects.

First, run spotbugs:spotbugs on each module (e.g. via mvn compile spotbugs:spotbugs), then run mvn spotbugs:spotbugs-aggregate from 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-aggregate goal to the <reporting> section of the root POM and run mvn site after compiling all modules.

[top]


How do I avoid OutOfMemory errors?

When running spotbugs on a project, the default heap size might not be enough to complete the build. For now there is no way to fork spotbugs and run with its own memory requirements, but the following system variable will allow you to do so for Maven:

export MAVEN_OPTS=-Xmx384M

You can also use the fork option which will fork a new JVM. You then use the maxHeap option to control the heap size.

[top]


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.

[top]