Finding source paths using the FindBugs ant function

I am trying to get the FindBugs ant task to include the source information in the generated report.

<findbugs home="${findbugs.home}" output="xml" outputFile="${basedir}/findbugs/findbugs-${package.basename}.xml" excludeFilter="${basedir}/findbugsExclude.xml" jvmargs="-Xmx1048m">
    <sourcePath path="${package.srcdir}" />
<class location="${package}" />
<auxClasspath>
    <path refid="findbugs.auxinput" />
    </auxClasspath>
</findbugs>

The value of the attribute $ {package.srcdir} is correct as far as I can see; it points to the root of the source tree that $ {package.srcdir} /com/mydomain/MyClass.java is the path to the source file.

Generated reports contain an element <SrcDir>that corresponds to the source path specified in the ant task, therefore, apparently, the element is <sourcePath>processed by the findbugs task. Despite this, the package statistics in the XML reports contain only sourceFile="&lt;Unknown&gt;".

Am I missing something obvious?

+3
source share
2 answers

.

, "-g: none". ant <javac> , < javac debug = true > .

( findbugs) ( eclipse - src). .

, afaik , findbugs .

, Christian

+5

, (inl ine ):

<echo message="Finding Bugs From ${package.srcdir}"/>  

, package.srcdir .

<sourcePath path="${basedir}/src/com" />

, .


, .

-1

Source: https://habr.com/ru/post/1717619/


All Articles