tags:

views:

21

answers:

0

I have an ANT target that runs findbugs twice on the same source code to generate a xml and html report

<delete dir="${findbugs.dir}"/>
<mkdir dir="${findbugs.dir}"/>        
<findbugs 
    home="${findbugs.home}"
    output="xml"
    outputFile="${findbugs.dir}/findbugs.xml"
    jvmargs="${findbugs.jvmargs}"
    timeout="${findbugs.timeout}"
    effort="${findbugs.effort}">
   <sourcePath path="${src.dir}"/>
   <class location="${build.classes.dir}"/>
</findbugs>

<findbugs 
    home="${findbugs.home}"
    output="html"
    outputFile="${findbugs.dir}/findbugs.html"
    jvmargs="${findbugs.jvmargs}"
    timeout="${findbugs.timeout}"
    effort="${findbugs.effort}">
   <sourcePath path="${src.dir}"/>
   <class location="${build.classes.dir}"/>
</findbugs>

This is dumb since the html report can be generated from the xml report using

<xslt in="${findbugs.dir}/findbugs.xml" out="${findbugs.dir}/findbugs.html" style="${findbugs.home}/default.xsl"/>

but the generated html report doesn't have the correct source code references. Any ideas on how I can get this working and avoid the duplicate findbugs call?