[英]Finetuning FindBugs ant task in Eclipse
在eclipse中,我能夠定義從首選項頁面報告的檢測器ID和錯誤類別 。
我在FindBugs文檔中找不到類似FindBugs ant任務的東西,或者在Eclipse ant編輯器中使用自動完成。
我可以調整的是努力和報告級別 。
將探測器和類別調整為無證或缺失的功能還是我錯過了什么? 它是如何在FindBugs Eclipse插件中解決的?
我和findbugs和ant也有一些問題。 這是我最后做的:
<taskdef name="findbugs"
classpathref="build_libs"
classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
<!--
Executes findbugs for a unpacked plugin (folder)
Params:
plugin: the plugin / module to fetch
plugin_dir: the folder to checkout the plugin to
-->
<target name="run.findbugs">
<echo level="info">Running FindBugs: ${plugin}</echo>
<findbugs home="${FINDBUGS.HOME}"
output="xml:withMessages"
outputFile="${report.dir}/findbugs_report_${plugin}.xml"
timeout="1200000"
includefilter="report/YOUR_findbugs_filter.xml"
excludefilter="report/YOUR_findbugs_exclude_filter.xml"
jvmargs="-server -Xss1m -Xmx512m">
<sourcepath location="${plugin_dir}/${plugin}/**/*.java" />
<class location="${install}/plugins/${plugin}_*.jar" />
</findbugs>
</target>
<!--
Executes findbugs for a single eclipse plugin
Params:
plugin: the plugin / module to fetch
plugin_dir: the folder to checkout the plugin to
-->
<target name="run.findbugs.unpacked">
<echo level="info">Running FindBugs: ${plugin} (unpacked)</echo>
<path id="rfu.pfp">
<fileset dir="${install}/plugins/">
<include name="${path_to_jar}" />
</fileset>
</path>
<property name="plugin_fullpath" refid="rfu.pfp" />
<findbugs home="${FINDBUGS.HOME}"
output="xml:withMessages"
outputFile="${report.dir}/findbugs_report_${plugin}.xml"
timeout="1200000"
includefilter="report/YOUR_findbugs_filter.xml"
excludefilter="report/YOUR_findbugs_exclude_filter.xml"
jvmargs="-server -Xss1m -Xmx512m">
<class location="${plugin_fullpath}" />
</findbugs>
</target>
調用任務:
解壓插件:
<antcall target="run.findbugs.unpacked">
<param name="plugin" value="com.myplugin.core" />
<param name="path_to_jar" value="com.myplugin.core_*/*.jar" />
</antcall>
插入:
<antcall target="run.findbugs">
<param name="plugin" value="com.myplugin.core" />
</antcall>
希望有幫助......
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.