Can't make findbugs work on a Maven Build.

The log apparently says everything is ok, but no report is presented:

[14:42:58]: Publishing artifacts
[14:42:58]: [Publishing artifacts] Paths to  publish:  [D:\Java\TeamCity\buildAgent\temp\buildTmp\.tc-maven-bi\maven-build-info.xml.gz  => .teamcity]
[14:42:58]: [Publishing artifacts] Sending files
[14:42:59]: Waiting for 1 service processes to complete
[14:42:59]: FindBugs report watcher
[14:42:59]: [FindBugs report watcher] 1 report found for paths:
[14:42:59]: [FindBugs report watcher] D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948/target/findbugs.xml
[14:42:59]: [FindBugs report watcher] Successfully parsed
[14:42:59]: [Successfully parsed] 1 report
[14:42:59]: [Successfully parsed] target\findbugs.xml
[14:42:59]: Publishing internal artifacts (2s)
[14:43:02]: [Publishing internal artifacts] Sending build.finish.properties file
[14:42:59]: Publishing artifacts (50s)
[14:42:59]: [Publishing artifacts] Paths to publish: [D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948\target]
[14:43:02]: [Publishing artifacts] Sending files
[14:43:50]: Build finished


Does anyone was able to make findbugs work with a Maven Build?
8 comments
Comment actions Permalink

Hello, Vitor,

Do you mean that there is no "Code inspection" tab present for the build?
Could you please attach the target/findbugs.xml.

0
Comment actions Permalink

"Do you mean that there is no "Code inspection" tab present for the build?"

Yeap. I tried with PMD, and it worked well.

"Could you please attach the target/findbugs.xml"

I attached an edited version without the name of classes and code. (I couldn't attach otherwise... :/)

I think the problem has to do with the configuration of the path to FindBugs installation. I tried many things, but nothing changed.



Attachment(s):
findbugs-edited.xml
0
Comment actions Permalink

Vitor,

The problem seems to be in FindBugs version 1.2.1 that you are using. It's quite old. Our plugin supports FindBugs 1.3.8 and newer.
Please consider updating FindBugs.

0
Comment actions Permalink

I changed that, but nothing happened :(

[09:39:14]: [br.com.petrobras:sales] [INFO] [findbugs:findbugs {execution: default-cli}]
[09:39:14]: [br.com.petrobras:sales] [INFO] Using source root:
[09:39:14]: [br.com.petrobras:sales] [INFO] D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948\target\sales\WEB-INF\classes
[09:39:14]: [br.com.petrobras:sales] [INFO] Using test source root:
[09:39:14]: [br.com.petrobras:sales] [INFO] D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948\target\test-classes
[09:39:14]: [br.com.petrobras:sales] [INFO] Using normal effort.
[09:39:14]: [br.com.petrobras:sales] [INFO] Adding Source Directory: D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948\src\main\java
[09:39:14]: [br.com.petrobras:sales] [INFO] Adding Source Directory: D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948\target\generated-sources\axistools
[09:39:14]: [br.com.petrobras:sales] [INFO] Using normal threshold.
[09:39:15]: [br.com.petrobras:sales] [INFO] Using FindBugs Version: 1.3.8
[09:39:15]: [br.com.petrobras:sales] [INFO] Using normal threshold.
[09:39:15]: [br.com.petrobras:sales] [INFO] Using normal threshold.
[09:39:15]: [br.com.petrobras:sales] [INFO] Using the xdoc format
[09:39:15]: [br.com.petrobras:sales] [INFO] Using normal effort.
[09:39:15]: [br.com.petrobras:sales] [INFO] Using normal threshold.
[09:39:15]: [br.com.petrobras:sales] [INFO] Using normal threshold.
[09:39:16]: [br.com.petrobras:sales] [INFO] Debugging is Off
[09:39:16]: [br.com.petrobras:sales] [INFO] No bug include filter.
[09:39:16]: [br.com.petrobras:sales] [INFO] Using bug exclude filter findbugs-exclude.xml
[09:39:45]: [br.com.petrobras:sales] [INFO] Printing Errors
[09:39:45]: [br.com.petrobras:sales] [INFO] Printing Missing classes
[09:39:45]: [br.com.petrobras:sales] [INFO] Printing Source Roots
[09:39:46]: [br.com.petrobras:sales] D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948\target\findbugs.xml report processed: 0 errors, 0 warnings, 0 info messages
[09:39:47]: [br.com.petrobras:sales] [INFO] [pmd:pmd {execution: default-cli}]
[09:39:47]: [br.com.petrobras:sales] [WARNING] Unable to locate Source XRef to link to - DISABLED
[09:39:58]: [INFO] ------------------------------------------------------------------------
[09:39:58]: [INFO] BUILD SUCCESSFUL
[09:39:58]: [INFO] ------------------------------------------------------------------------
[09:39:58]: [INFO] Total time: 2 minutes 30 seconds
[09:39:58]: [INFO] Finished at: Fri Jun 17 09:39:58 BRT 2011
[09:39:58]: D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948\target\pmd.xml report processed: 50 errors, 1 warning, 149 info messages
[09:39:58]: [INFO] Final Memory: 61M/247M
[09:39:58]: [INFO] ------------------------------------------------------------------------
[09:39:58]: Process exited with code 0
[09:39:58]: Publishing artifacts
[09:39:58]: [Publishing artifacts] Paths to publish: [D:\Java\TeamCity\buildAgent\temp\buildTmp\.tc-maven-bi\maven-build-info.xml.gz => .teamcity]
[09:39:59]: [Publishing artifacts] Sending files
[09:39:59]: Waiting for 1 service processes to complete
[09:40:00]: FindBugs report watcher
[09:40:00]: [FindBugs report watcher] 1 report found for paths:
[09:40:00]: [FindBugs report watcher] D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948/target/findbugs.xml
[09:40:00]: [FindBugs report watcher] Successfully parsed
[09:40:00]: [Successfully parsed] 1 report
[09:40:00]: [Successfully parsed] target\findbugs.xml
[09:40:00]: PMD report watcher
[09:40:00]: [PMD report watcher] 1 report found for paths:
[09:40:00]: [PMD report watcher] D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948/target/pmd.xml
[09:40:00]: [PMD report watcher] Successfully parsed
[09:40:00]: [Successfully parsed] 1 report
[09:40:00]: [Successfully parsed] target\pmd.xml
[09:40:00]: Publishing internal artifacts (1s)
[09:40:01]: [Publishing internal artifacts] Sending build.finish.properties file
[09:40:00]: Publishing artifacts (1m:02s)
[09:40:00]: [Publishing artifacts] Paths to publish: [D:\Java\TeamCity\buildAgent\work\ad6f664c6fbe7948\target]
[09:40:01]: [Publishing artifacts] Sending files
[09:41:02]: Build finished
[09:41:03]: Total: 178 (+0 -0) Errors: 51 (+0 -0)



Attachment(s):
findbugs-edited.xml
0
Comment actions Permalink

i tried to run online scanner for version 1.3.8 and got a liitle bit different report format - <buginstance> isn't wrapped in <file>. you can run http://findbugs.cs.umd.edu/demo/jnlp/findbugs.jnlp against your code, exprot result and put it directly in the buildagent working directory. Then try to import to check is it ok.



Attachment(s):
findbugs-1.3.8.xml
0
Comment actions Permalink

Vitor,

The attached report doesn't match the supported schema (we got bugcollection.xsd schema from FindBugs sources).
BTW The report that Alexander attched matches it.

Actually Maven generates a different kind of report in xdoc format (see Examples section at http://mojo.codehaus.org/findbugs-maven-plugin/)
But you can configure it to generate pure FindBugs xml (see http://mojo.codehaus.org/findbugs-maven-plugin/usage.html)

Let me know if facing any problems.

0
Comment actions Permalink

Alexander,

Your report absolutely matches the scheme supported in TeamCity.

0
Comment actions Permalink

Yeah, this made the trick. I didn't realize that Maven was generating a different kind of report... Thank you (all) very much! :)

0

Please sign in to leave a comment.