PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Run FindBugs from your Eclipse RCP headless build

Note: This article was originally published at Planet PHP on 25 November 2010.
Planet PHP
Running FindBugs from Eclipse RCP headless build is pretty much simple:

1. Add the following target to your customTargets.xml (replace "com.yourcompany" with your package/plug-in prefix):




































classname="edu.umd.cs.findbugs.anttask.FindBugsTask"









home="${env.FINDBUGS_HOME}/lib"
output="xml"
failOnError="true"
jvmargs="-server -Xss1m -Xms512m -Xmx1024m"
includeFilter="${basedir}/findbugs-filter.xml"
outputFile="${buildDirectory}/findbugs.xml"







2. Create input filter file (findbugs-filter.xml):







3. Invoke "findbugs" target from the "prePackage" target:












4. Make sure environment variable FINDBUGS_HOME points to the installation of FindBugs.

5. (For Hudson users) Install, and configure FindBugs plug-in to get the fancy "bugs" trend graph :-)