FindBugs

A Bug Pattern Detector for Java

Table des matières :

Integration dans ant

To incorporate FindBugs into build.xml (the build script for Ant), you first need to add a task definition. This should appear as follows:
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/>
The task definition specifies that when a findbugs element is seen in build.xml, it should use the indicated class to execute the task.
After you have added the task definition, you can define a target which uses the findbugs task. Here is an example which could be added to the build.xml for the Apache BCEL library.

<property name="findbugs.home" value="/export/home/daveho/work/findbugs" /> <target name="findbugs" depends="jar"> <findbugs home="${findbugs.home}" output="xml" outputFile="bcel-fb.xml" > <auxClasspath path="${basedir}/lib/Regex.jar" /> <sourcePath path="${basedir}/src/java" /> <class location="${basedir}/bin/bcel.jar" /> </findbugs> </target>
The findbugs element must have the home attribute set to the directory in which FindBugs is installed; in other words, $FINDBUGS_HOME.

Source : http://www.cs.umd.edu/~pugh/java/bugs/manual/
findbugs home page
maven-lugin / findbugs
Dowload section (jar, ant plugin, ...)


Article extrait du site Loribel.com.
https://loribel.com/java/tools/findbugs.html