Different FindBugs output ant Vs. TeamCity

Hello *,

I am using TeamCitys ant Build runner to run a FindBugs analysis on my java code. The target in my build.xml looks like

    <!-- ==================== Run FindBugs Target ============================= -->

    <target name="runfindbugs" depends="clean, compile" description="Find possible bugs with FindBugs">

        <available file="${env.FINDBUGS_HOME}/lib/findbugs.jar" property="findbugs.available"/>
        <fail unless="findbugs.available" message="Error: FINDBUGS_HOME not set or lib/findbugs.jar not found."/>

        <findbugs home="${env.FINDBUGS_HOME}" failOnError="true" jvmargs="-server -Xmx256m -Djava.ext.dirs=${lib.home}"
                            effort="max" excludeFilter="excludeFilter.xml" warningsProperty="findbugsWarning" errorProperty="findbugsError"
                            output="html" outputFile="findbugsReport.html">
            <class location="${build.home}" />
                <path refid="compile.classpath" />
            <sourcePath location="${src.home}" />

        <fail if="findbugsError" message="at least one error found by findBugs" />
        <fail if="findbugsWarning" message="at least one warning found by findBugs" />


Calling this target with ant on command line FindBugs reports 0 high prirority warnings, 0 medium priority warnings and 59 low prirority warnings while running the same target triggered by TeamCity reports 0 high prirority warnings, 2 medium priority warnings and 40 low prirority warnings. What could be a reason for this difference? Do I have to pass additional ant or java command line args in my ant build runner settings section? Any other suggestions?

Many thanks in advance

1 comment
Comment actions Permalink

Hello Enrico,

  I suppose there are some differences between local command-line environment and TeamCity environment.
  It may JDK version, some classpath issues or something like that.

  It is impossible to say exactly what is the reason of the problem given the information you provided.

  Please try running your build from the exactly same location as it is run by TeamCity (see build log).
  You can also investigate the problem by reading the build log and details of FindBugs output/reports.

  Kind regards,


Please sign in to leave a comment.