how do I link the bugs to the src file when using the findbugs ant task?
how do I开发者_运维问答 link the bugs to the src file when using the findbugs ant task?
Use sourcePath
, an optional nested element which specifies a source directory path containing source files used to compile the Java code being analyzed. By specifying a source path, any generated XML bug output will have complete source information, which allows later viewing in the GUI.
<target name="findbugs">
<findbugs home="${findbugs.home}" output="xml" outputFile="findbugs_report.xml">
<auxClasspath path="${basedir}/lib" />
<sourcePath path="${basedir}/src/java" />
<class location="${basedir}/bin" />
</findbugs>
</target>
精彩评论