English 中文(简体)
Eclipse的FindBugs修课
原标题:Finetuning FindBugs ant task in Eclipse

在单体内 我可以界定detector idsbug category,从优惠页上报告。

I can t find anything like that for the FindBugs ant task in the FindBugs docs or using autocomplete inside the Eclipse ant editor.

我可以调整的是effortreport水平

检测器和分类是否调整了无证件或缺失的特征,或者我没有错过的东西? 如何在FindBugs Eclipse plugin中解决?

问题回答

I had some issues with findbugs and ant as well. Here is what I ve done finally:

<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>

任务:

Unpacked plugin:

<antcall target="run.findbugs.unpacked">
    <param name="plugin" value="com.myplugin.core" />
    <param name="path_to_jar" value="com.myplugin.core_*/*.jar" />
</antcall>

<>strong>plugin:

<antcall target="run.findbugs">
    <param name="plugin" value="com.myplugin.core" />
</antcall>

希望......





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签