I have create a custom SpotBugs plugin for maven like described here in a multi-module maven project. But I cannot figure out how to use it. There really is not much documentation or examples for this.
Like described here I have used pluginList
and plugins
configuration properties for SpotBugs. But it does not report the bug when I run spotbugs:spotbugs
. Other bugs are reported. Any idea what the problem might be?
I am using Spotbugs in maven like this:
<reporting>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.plugin.version}</version>
<configuration>
<pluginList>custom-spotbugs.jar</pluginList>
<plugins>
<plugin>
<groupId>com.example</groupId>
<artifactId>custom-spotbugs</artifactId>
<version>${custom.build.version}</version>
</plugin>
</plugins>
</configuration>
</plugin>
</plugins>
</reporting>
Edit: I noticed that I had to run mvn site
for the reporting plugins to work. But the next problem is that the configuration values cannot be changed. I had <effort>Max</effort>
in the configuration and even if I remove it, it is still used. Are the configuration cached or something?