dev@glassfish.java.net

Re: findbugs-maven-plugin

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Wed, 04 Feb 2009 15:25:23 -0800

Maven is always such an adventure... :-(

If I run "mvn findbugs:findbugs", it produces no output. The docs say:

   Generates a FindBugs Report when the site plugin is run. The HTML report
   is generated for site commands only.

I think that means I have to run "mvn site" to get any output (why?).
So I do that and it dies with:

[FATAL ERROR] Container realm = plexus.core
urls[0] = file:/opt/maven/lib/maven-2.0.9-uber.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org/apache/maven/model/PluginManagement
org.apache.maven.model.PluginManagement
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/maven/model/PluginManagement
        at
org.apache.maven.report.projectinfo.PluginManagementReport.canGenerateReport(PluginManagementReport.java:106)
...


Grumble. Now what?


So then I try the findbugs:check goal, which says:

   Fail the build if there were any FindBugs violations in the source code.
   An XML report is put out by default in the target directory with the errors.

Yes, it's true, the goal that you would think would produce output produces
no output, and the goal you would think would produce no output produces
output. What drugs are these people on?!?!

Anyway, running that gives:

The following classes needed for analysis were missing:
   javax.annotation.Nonnull
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] failed with 79 bugs and 0 errors

Despite the error, it did produce the output file.

But if it needed javax.annotation.Nonnull, shouldn't it have included
a dependency on whatever module defines it?

Well, at least I got an output file, but xml is a pain to read so I decide
to try the GUI with "mvn findbugs:gui". The docs say:

   Launch the Findbugs GUI. It will use all the parameters in the POM fle.

The GUI comes up with no knowledge of my files at all. Sigh. Exactly
what parameters in the POM file is it using?

And if I try to run "mvn findbugs:gui &" it stops with SIGTTIN.
Why is the GUI (or is it maven?) trying to access the tty while it's running?


I know, I know, I'm complaining to the wrong people. Sorry. At least
*I* feel better now... :-)