I'm trying to get the FindBugs ant task to include source info in the generated report.
<findbugs home="${findbugs.home}" output="xml" outputFile="${basedir}/findbugs/findbugs-${package.basename}.xml" excludeFilter="${basedir}/findbugsExclude.xml" jvmargs="-Xmx1048m">
<sourcePath path="${package.srcdir}" />
<class location="${package}" />
<auxClasspath>
<path refid="findbugs.auxinput" />
</auxClasspath>
</findbugs>
The value of the ${package.srcdir} attribute is correct as far as I can see; it points to the root of the source tree such that ${package.srcdir}/com/mydomain/MyClass.java is the path of the source file.
The generated reports contains a <SrcDir>
element which matches the source path given to the ant task, so apparently the <sourcePath>
element is handled by the findbugs task. Despite this, the package stats in the XML reports only contains sourceFile="<Unknown>"
.
Am I missing something obvious?