How to setup FindBugs with Maven on eclipse

Before you proceed with this exercise, it's required to check my blog on how to create a modular maven project. http://czetsuya-tech.blogspot.com/2012/04/how-to-create-modularized-maven-project.html

1.) In this link you will see the available maven goals for FindBugs:
http://mojo.codehaus.org/findbugs-maven-plugin/plugin-info.html
 findbugs:check
 findbugs:findbugs
 findbugs:gui
 findbugs:help

2.) Then we need to add several lines to ipiel-portal's pom.xml, in the reporting->plugins section add:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>findbugs-maven-plugin</artifactId>
    <version>2.4.1-SNAPSHOT</version>
    <configuration>
     <xmlOutput>true</xmlOutput>
     <!-- Optional directory to put findbugs xdoc xml report -->
     <xmlOutputDirectory>target/site</xmlOutputDirectory>
    </configuration>
   </plugin>

3.) Create a new Run Configuration -> Maven as follows:

4.) Run the new run configuration and you should have findbugsXml.xml file generated inside target folder.

How to setup FindBugs with Maven on eclipse How to setup FindBugs with Maven on eclipse Reviewed by Edward Legaspi on Monday, April 09, 2012 Rating: 5

No comments:

Powered by Blogger.