Name

FindBugs plugin

Version

2.0

Product Versions

2.1.x - 2.2.x

Author(s)

Stephan Paulicke

Maintainer

Made Mastika, James Dumay, Dushan Hanuska, Lilians Auvigne

Price

Free

License

BSD

JavaDocs

Bamboo Findbugs Plugin 2.0

IssueTracking

http://jira.atlassian.com/browse/FNDBUG

Subversion URL

bamboo-findbugs-plugin-2.0

Download JAR

bamboo-findbugs-plugin-2.0.jar

Description/Features

A plugin that will parse and record FindBugs reports

Usage

  1. Copy the file into your <BAMBOO_HOME>/webapp/WEB-INF/lib directory and restart Bamboo
  2. In the configuration of your plan, there should be a new FindBugs section on the 'Builder Configuration' tab. Here you can specify whether your plan generates FindBugs reports, and if so, the location of the XML report file.
  3. The plugin will also work with maven-findbugs-plugin (recommended)
  4. That should be it, you should now see a FindBugs tab on your Plan and on any new builds that generate FindBugs report files.

Screenshots

Version History

Version

Date

Description

2.0

25 September 2008

Released compatible 2.1.x. version included FNDBUG-25 FNDBUG-24 FNDBUG-23 FNDBUG-19 FNDBUG-18

2.0-beta1

28 April 2008

Released 2.0 compatible version to public. 1.2.x is not longer supported.

1.1.2

12 February 2008

fixed

  • No labels

34 Comments

  1. Stephan,

    Mate that's awesome! I'll try to check it out soon, but it looks neat regardless.

    Cheers,

    Mark C

  2. I'm having problems getting this plugin to work.

    It installs fine, and I can see that it accesses the maven-generated findbugs.xml file. But the results all display as 0 bugs, even though there are bugs recorded in the xml file. These 0 values appear as such in the database, so I believe the problem is somewhere near the initial parsing phase.

     I am using Bamboo 1.2.4.

    Thanks,

    Val Tarasyuk

    1. Hi Val,

      The problem with the previous version is that it will only read findbugs xdoc generated report which is not what FindBugs output by default. The issue has been addressed in 1.1.0 release and now it should be able to pick up the result in either xdoc or it's default xml format. I recommend you to use maven-findbugs-plugin so it'll take most of the burdens away (writing up those jelly scripts as well as compatibility with maven 2) from you. Just specify **/target/* in the output destination field, and it should work properly.

      Please leave us some feedback on how to improve it.

      Cheers,

      Made

  3. The problem I was having with this plugin was that it only failed builds on a delta. Which made it not detect findbugs problems introduced together with other causes of build breakage. Also, it was possible to make a build "green" by simply re-running a failed build. This patch makes bamboo fail a build if there are any findbugs violations present. For an anal-retentive project manager like me, this is a must (smile)

    1. S

      I have a related problem that following a broken build (which wrongly records 0 findbugs errors) the next sucessful build records a delta now that findbugs has ran and recorded the actual number of errors.

      This is a problem since we've set our builds to fail when deltas are found.

  4. S

    Many thanks for releasing an updated findbugs plugin for Bamboo, I was waiting on this before migrating to Bamboo 2.

    However, on my Bamboo installation the findbugs artifact copier is failling with the message "FindBugs plugin is not run because the build has failed". This is wrong, as the build has succeeded. Do you have any hints at resolving this?

  5. Hi,

    I have exactly the same problem Stephen reported (running Bamboo 2.0.1)... I'd love to have FindBugs reports integrated, looking forward to a patch.

    Cheers,

    Stanislaw

    1. I experienced the "build has failed" bug with the 2.0-beta1 version, so I tried with the current code in trunk (revision 19480). I'm not a Java developer so hopefully someone with more experience can take a look at this and check my work.

      I believe there are two bugs which are contributing to the issue, both in thecom.atlassian.bamboo.plugins.findbugs.FindBugsBuildProcessor class. The first is on line 97 of the source, where the currentBuildState is initially assigned – the object ends up equal to null. I'm not sure why that's happening; maybe a Bamboo developer can add some insight as to the cause.

      The second issue is on line 102, where the currentBuildState object is checked for success. I believe this line should use the equals() method for comparison of the two objects.

      As a test (but not a fix), I commented out the state check and the FindBugs plugin worked as expected.

      1. I also found a bug in com.atlassian.bamboo.plugins.findbugs.actions.ViewFindBugsBuildResults, revision 19480. The serializeCsv() method can throw an uncaught NoSuchElementException on line 132 when processing a line such as "class,1,,TYPE" (where the source field is empty). I believe the StringTokenizer is skipping the empty field when parsing.

        I'm attaching two patches: one for my previously mentioned "fix" for the "build has failed" bug, and one to address the CSV parsing bug.

        For the StringTokenizer bug, I converted the code to use String object's split() method as suggested by the Sun 1.4.2 docs for StringTokenizer.

        1. I've not gone very deeply into Bambo API, but it looks like the FindBugsBuildProcessor is invoked _during_ the build, which would mean the build status is not known yet, hence the null value (I may be wrong though -- the API says it's the partial build result...). Anyway, your "fix" might actually be a fix (without quotes (wink). Another hint that could confirms this reasoning is the <skipIfFailed>true</skipIfFailed> entry in the config file, which seems to do the job of the condition in the code.

          Philip -- would it be possible for you to somehow make the binary you compiled available? I'd love to use this plugin without investing 2h into compiling it from sources (smile)

          Thanks!

          1. Stanislaw (and others who are interested): I attached my patched build of the FindBugs plugin to this thread.

            1. The plugin works great now, thanks Philip!

  6. Hi,

     I am using the plugin, and I can see the violations graph (first screenshot above).  How do I get to the other charts/tables (screenshots 2 & 3)?

     Thanks!

    1. The second screenshot is a FindBugs Violation Change By Author report, which you'll find under Reports.

      The third screenshot is a tab of FindBugs page when you look at a specific build that produced FindBugs data.

  7. Hi there,

    It looks like enabling this plugin is causing the issue as below. Have you experienced anything similar?

    Cheers,

    Staszek

    When I try to generate any report (e.g. Build Activity) for All builds or Last 90 days (did not check range), I'm getting an exception as pasted below. Reports work fine for smaller ranges, i.e Last 30 and 7 days.

    Version: 2.0.5
    Build: 807
    Build Date: 24-Jun-2008

    Stack Trace:

    java.lang.IllegalArgumentException: Invalid complete key specified: null
    at com.atlassian.plugin.ModuleCompleteKey.(ModuleCompleteKey.java:17)
    at com.atlassian.plugin.DefaultPluginManager.getPluginModule(DefaultPluginManager.java:343)
    at com.atlassian.bamboo.v2.build.trigger.TriggerReasonManagerImpl.getTriggerReason(TriggerReasonManagerImpl.java:32)
    at com.atlassian.bamboo.index.BuildResultsSummaryDocumentFactory.getBuildResultsSummary(BuildResultsSummaryDocumentFactory.java:155)
    at com.atlassian.bamboo.resultsummary.search.IndexedBuildResultsSearcherImpl.search(IndexedBuildResultsSearcherImpl.java:52)
    at com.atlassian.bamboo.resultsummary.search.IndexedBuildResultsSearcherImpl.search(IndexedBuildResultsSearcherImpl.java:36)
    at com.atlassian.bamboo.ww2.actions.reports.ViewReport.runReport(ViewReport.java:130)
    at com.atlassian.bamboo.ww2.actions.reports.ViewReport.doGenerate(ViewReport.java:122)
    at sun.reflect.GeneratedMethodAccessor1798.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)

    [snip]

    1. Hi Staszek,

      Would you mind to create a bug at http://jira.atlassian.com/browse/FNDBUG project? You can attach the log file and provide more details there as well.

      Thanks,
      Dushan

  8. Good point! I've filed the issue here:

    http://jira.atlassian.com/browse/FNDBUG-21\\

    Cheers,

    Staszek

  9. I notice this project is in active development through your Jira page - when can we expect a version compatible with 2.1?

    Just upgraded to Bamboo 2.1 and really miss this plugin already (smile)

    1. Well, it really depends on how much of my free time or my 20% project time I can spend on this, as this plugin is not supported or actively developed by Atlassian. At the moment I do not have much spare time. Please let me know if you can or are willing to contribute.

      1. The trunk version works fine on bamboo 2.1.
        I can release it.

        Cheers.
        Lilians

        1. That would be fantastic, thanks!

  10. Two days ago, I pulled from Trunk, built and installed the plugin and I am still seeing the: FindBugs plugin is not run because the build has failed.  The build was sucessful.   Any further developments in this area ?  Note, FindBugs was not run in this build plan.  Final comment,   Where is the mentioned patch for this and the parsing error reported ?

    1. There has not been any work done on this for some time. I will spend some of my 20% on this next week.

      1. The patch of this following issue solved this problem. http://jira.atlassian.com/browse/FNDBUG-18

        Cheers
        Lilians

  11. The following text is from the Checkstyle plugin comments and the error also effects  the Findbugs plugin:

    Don't know where to post this bug, but there are issues (NumberFormatException), when you try to generate statistics, while the checkstyle plugin is active. (Unfortunately this effects all statistics - not only the checkstyle statistics).

    These only happen under (for instance) a german locale.

    To fix go to CheckstyleIndexReader.addBuildToSummary(..) and change the line:

    double violations = Double.parseDouble(s);

    to

    double violations = NumberUtils.stringToDouble(s);

    This is needed because in the PostBuildIndexWriter the NumberUtils.padWithZeros(..)-method is used, which respects the current locale (and generates strings like "000001234,00"). A simple Double.parse() thus is not enough.

    The Findbugs plugin needs to be fixed in the following locations:

    FindBugsLineRateViolationCollator Line 51: 

                violations += NumberUtils.stringToDouble(buildData.get(name));

    TimePeriodFindBugsDeltaCollater Line 40:

                    totalDelta += NumberUtils.stringToDouble(violations) / (double) getAuthorCount(results);
     

    IndexReader , Line 60:

                    NumberUtils.stringToDouble(s);

    also in the catch-clause adding a "?" is a bad idea because it will crash later on again with a NumberFormatException, maybe use "0".

      1. No. These are totally different bugs.

  12. hi,

    can anyone help configure bamboo to read the XML file that generated by the bamboo ant plan

    iam having a problem configuring the path to the xml file

    is there an example of the path 

    thanks

  13. hello

    i've wondering if bamboo-findbugs-plugin-2.0-beta.jar is compatible with bamboo 2.1.1 build 1001 cause there is no data appear in the findbugs tap after the ant is completed successfully and with this message "FindBugs plugin is not run because the build has failed"  

    note the path to the xml result is also configured

    cheers

    1. Use the new JAR file from above.

  14. Hi there,

    with Bamboo 2.3 we get the error:

    21-Aug-2009 13:14:08	Failed to execute plugin 'FindBugs Build Processor' with error: com.atlassian.bamboo.v2.build.BuildPlanDefinition.getRepository()Lcom/atlassian/bamboo/v2/build/repository/RepositoryV2;
    

    Thomas

    1. We have the same error with Bamboo 2.3.1

  15. I adapted the code to Bamboo 2.3.1. If someone can give me write access to the repository I would like to check it in.

  16. Strangely the 2.0 version works fine for our 2.4.0 installation. We use it in a Maven build with the org.codehaus.mojo:findbugs-maven-plugin.