title: Findbug - ANT xslt stylesheet source code references
body: <p>I have an ANT target that runs findbugs twice on the same source code to generate a xml and html report</p>
  
  <pre><code>&lt;delete dir="${findbugs.dir}"/&gt;
  &lt;mkdir dir="${findbugs.dir}"/&gt;        
  &lt;findbugs 
      home="${findbugs.home}"
      output="xml"
      outputFile="${findbugs.dir}/findbugs.xml"
      jvmargs="${findbugs.jvmargs}"
      timeout="${findbugs.timeout}"
      effort="${findbugs.effort}"&gt;
     &lt;sourcePath path="${src.dir}"/&gt;
     &lt;class location="${build.classes.dir}"/&gt;
  &lt;/findbugs&gt;
  
  &lt;findbugs 
      home="${findbugs.home}"
      output="html"
      outputFile="${findbugs.dir}/findbugs.html"
      jvmargs="${findbugs.jvmargs}"
      timeout="${findbugs.timeout}"
      effort="${findbugs.effort}"&gt;
     &lt;sourcePath path="${src.dir}"/&gt;
     &lt;class location="${build.classes.dir}"/&gt;
  &lt;/findbugs&gt;
  </code></pre>
  
  <p>This is dumb since the html report can be generated from the xml report using</p>
  
  <pre><code>&lt;xslt in="${findbugs.dir}/findbugs.xml" out="${findbugs.dir}/findbugs.html" style="${findbugs.home}/default.xsl"/&gt;
  </code></pre>
  
  <p>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?</p>
  
  <p>Updated after answer</p>
  
  <pre><code>with output="xml"
  
  &lt;BugInstance type="REC_CATCH_EXCEPTION" priority="2" abbrev="REC" category="STYLE"&gt;
     &lt;Class classname="com.x.y.aggregate.AggregationProperties"&gt;
        &lt;SourceLine classname="com.x.y.aggregate.AggregationProperties" start="20" end="788" sourcefile="AggregationProperties.java" sourcepath="com/x/y/aggregate/AggregationProperties.java"/&gt;
     &lt;/Class&gt;
     &lt;Method classname="com.x.y.aggregate.AggregationProperties" name="setAggregateProperties" signature="()V" isStatic="true"&gt;
        &lt;SourceLine classname="com.x.y.aggregate.AggregationProperties" start="86" end="148" startBytecode="0" endBytecode="489" sourcefile="AggregationProperties.java" sourcepath="com/x/y/aggregate/AggregationProperties.java"/&gt;
     &lt;/Method&gt;
     &lt;SourceLine classname="com.x.y.aggregate.AggregationProperties" start="140" end="140" startBytecode="308" endBytecode="308" sourcefile="AggregationProperties.java" sourcepath="com/x/y/aggregate/AggregationProperties.java"/&gt;
  &lt;/BugInstance&gt;
  
  with 'xml:withMessages'
  
  &lt;BugInstance type="REC_CATCH_EXCEPTION" priority="2" abbrev="REC" category="STYLE" instanceHash="b7a7c8f292d2a8432680a1c971fb93b3" instanceOccurrenceNum="0" instanceOccurrenceMax="0"&gt;
     &lt;ShortMessage&gt;Exception is caught when Exception is not thrown&lt;/ShortMessage&gt;
     &lt;LongMessage&gt;Exception is caught when Exception is not thrown in com.x.y.aggregate.AggregationProperties.setAggregateProperties()&lt;/LongMessage&gt;
     &lt;Class classname="com.x.y.aggregate.AggregationProperties" primary="true"&gt;
        &lt;SourceLine classname="com.x.y.aggregate.AggregationProperties" start="20" end="788" sourcefile="AggregationProperties.java" sourcepath="com/x/y/aggregate/AggregationProperties.java" relSourcepath="com/x/y/aggregate/AggregationProperties.java"&gt;
           &lt;Message&gt;At AggregationProperties.java:[lines 20-788]&lt;/Message&gt;
        &lt;/SourceLine&gt;
        &lt;Message&gt;In class com.x.y.aggregate.AggregationProperties&lt;/Message&gt;
     &lt;/Class&gt;
     &lt;Method classname="com.x.y.aggregate.AggregationProperties" name="setAggregateProperties" signature="()V" isStatic="true" primary="true"&gt;
        &lt;SourceLine classname="com.x.y.aggregate.AggregationProperties" start="86" end="148" startBytecode="0" endBytecode="489" sourcefile="AggregationProperties.java" sourcepath="com/x/y/aggregate/AggregationProperties.java" relSourcepath="com/x/y/aggregate/AggregationProperties.java"/&gt;
        &lt;Message&gt;In method com.x.y.aggregate.AggregationProperties.setAggregateProperties()&lt;/Message&gt;
     &lt;/Method&gt;
     &lt;SourceLine classname="com.x.y.aggregate.AggregationProperties" primary="true" start="140" end="140" startBytecode="308" endBytecode="308" sourcefile="AggregationProperties.java" sourcepath="com/x/y/aggregate/AggregationProperties.java" relSourcepath="com/x/y/aggregate/AggregationProperties.java"&gt;
        &lt;Message&gt;At AggregationProperties.java:[line 140]&lt;/Message&gt;
     &lt;/SourceLine&gt;
  &lt;/BugInstance&gt;
  </code></pre>