views:

228

answers:

2
+1  Q: 

FindBugs and Maven

I would like Maven to generate a FindBugs report where the bugs are grouped by severity, not by file. Then I would be able to focus on the most serious bugs immediately. I have seen similar functionality with the FindBugs plugin for Eclipse. Is this possible with Maven?

+1  A: 

To answer you amended question, the findbugs-maven-plugin does not currently offer a way to sort bugs via severity. I would suggest you log an enhancement request to the project.

--What follows is my answer to the original question, which simply asked if there was a FindBugs Maven plugin. The question has since changed and is answered above.--

Yes, there is a findbugs-maven-plugin (note that while the documentation says 2.1-SNAPSHOT, they have released 2.1). Add this plugin to the reporting section of your POM and run maven clean site to see the report.

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>findbugs-maven-plugin</artifactId>
    <version>2.1</version>
    <configuration>
        <effort>Max</effort>
    </configuration>
</plugin>
shek
I was a bit unprecise, I was in fact talking about the findbugs-maven-plugin from Codehaus. But your configuration does not solve the problem, it merely configures the site build to include FindBugs report, and that is not the problem
Tore
I've answered your amended question and noted that my original answer what to the original question.
shek
+2  A: 

You should also have a look at Sonar. Its dashboard reports data generated by many code analysers like Findbugs, Checkstyle or Cobertura. It's really quick and easy to navigate in measures like Findbugs bugs. Of course it's possible to filter data by severity (see the page "violations drilldown"). The release 1.9 only supports two levels of severity (mandatory/optional) but next version will define five levels from info to blocker. It should be released next week.

Thanks for the tip!
Tore