Hudson can visualize the results of the FindBugs analysis of your class files. When this option is configured you need to set up your build to run findbugs in order to use this feature! This plug-in does not perform the actual analysis; it only displays useful information about analysis results, such as historical result trend, module and package statistics, web UI for viewing analysis reports and warnings, and so on.
pom.xml
file to enable the findbugs analysis:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>1.2</version> <configuration> <findbugsXmlOutput>true</findbugsXmlOutput> <findbugsXmlWithMessages>true</findbugsXmlWithMessages> <xmlOutput>true</xmlOutput> [...] </configuration> </plugin>Finally you need to specify the pattern
**/findbugsXml.xml
in order to get the correct results.
build.xml
, you
first need to add a task definition. This should appear as follows:
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/>After you have added the task definition, you can define a target which uses the
findbugs
task, e.g.:
<target name="findbugs" depends="jar"> <findbugs home="${findbugs.home}" output="xml:withMessages" outputFile="findbugs.xml" > <auxClasspath path="${basedir}/lib/Regex.jar" /> <sourcePath path="${basedir}/src/java" /> <class location="${basedir}/bin/bcel.jar" /> </findbugs> </target>Finally you need to specify the pattern
**/findbugs.xml
in order to get the correct results.