需求:使用findbugs的ant任务(编写ant脚本作Java代码的静态代码检查工作),指定两个不同的类文件的根目录
解决方案:定义两个sourcePath元素即可
示例:部份脚本内容
<target name="analyze">
<findbugs home="${findbugs.home}"
projectName="^_^"
output="xml:withMessages"
outputFile="${result.file.name}"
reportLevel="low"
effort="max"
>
<!-- visitors="LazyInit -->
<!-- reportLevel="high" -->
<!-- output="xml" -->
<!-- debug="true" -->
<auxClasspath path="${dependedLib.dir}/^_^.jar" />
<auxClasspath path="${dependedLib.dir}/^_^.jar" />
<!--
<sourcePath path="${basedir}/src/com" />
-->
<class location="${classes1.dir}" />
<class location="${classes2.dir}" />
</findbugs>
</target>