I don't get it... I want to enable findbugs report in a Maven 3 project site and did it by adding this to my pom.xml (As described here):
<project>
...
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.4.0</version>
</plugin>
</plugins>
</reporting>
...
</project>
Then I ran mvn site
but no report is generated. Interesting thing is when I use version 2.3.1 instead then a report is generated. But 2.3.2 or 2.4.0 doesn't work. When running mvn site -X
then the relevant output is this:
[DEBUG] Inside canGenerateReport..... false
[DEBUG] canGenerate is false
[DEBUG] class org.codehaus.mojo.findbugs.FindBugsGui isMavenReport: false
[DEBUG] skip non MavenReport org.codehaus.mojo:findbugs-maven-plugin:2.4.0:gui
What is this canGenerate
stuff? What's going wrong here?
FindBugs is a static code analysis tool which identifies problems found from Java code. We can integrate FindBugs into our build process by using the FindBugs Maven plugin. This blog post identifies four typical use cases and describes how we can configure the FindBugs Maven plugin to support each use case.
To generate the FindBugs report as part of the Project Reports, add the FindBugs plugin in the <reporting> section of your pom. xml. Then, execute the site plugin to generate the report.
FindBugs is an open source tool used to perform static analysis on Java code. In this article, we're going to have a look at setting up FindBugs on a Java project and integrating it into the IDE and the Maven build.
Ah, found the problem. The project must be compiled first. Plugin version 2.3.1 triggered a compile automatically but since 2.3.2 this is no longer the case. So after a mvn clean
I have to run mvn compile site
to get a report.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With