FindBugs Plugin

This plugin generates the trend report for FindBugs, an open source program which uses static analysis to look for bugs in Java code. 

Description

The FindBugs plug-in scans for findbugs.xml files in the build workspace and reports the number of warnings found. This plug-in is part of the suite of static code analysis plug-ins that are documented on a separate WIKI page.

The following features are provided by this plug-in:

  • Configuration of the files to scan after a build.
  • Build summary showing the new and fixed warnings of a build
  • Trend reports showing the number of warnings in corresponding colors
    • Severity Trend: visualizes the number of warnings per severity
    • Threshold Trend: visualizes the number of warnings below and above the health thresholds
  • Overview of the found warnings per module, package, category, or type
    • Parsing of Maven pom.xml or Ant build.xml configuration files to obtain the module or project name
    • Parsing of Java or C# files to obtain the package or name space name
  • Detail reports of the found warnings optionally filtered by severity (or new and fixed)
    • Short messages is read from the report file
    • Detailed description is read from the FindBugs library
  • Colored HTML display of the corresponding source file and warning lines:
    • Direct link to the warning line
    • Highlighting of single lines as well as line ranges
    • Highlighting of multiple line ranges per warning (different color for primary range)
    • Tool tip describing the warning message
  • Failure threshold to mark a build as unstable
  • Configurable project health support
  • Support for the findbugs ant task and the maven-findbugs-plugin 1.1.1 and newer
  • Works with the freestyle and native m2 build option of Hudson (activated on goal findbugs:findbugs or site)
  • Localization available for: DE (Please help to localize findbugs for your locale!)

The current release is available in the download section. This plug-in is developed and maintained by Ullrich Hafner. Please use the Hudson mailing lists or issue tracker to ask questions, create feature request or bug reports, since I don't read the comment section on this page regularly.

Changelog

HEAD:

  • New and fixed warnings of are now computed using the refactoring-aware hash codes of the findbugs plugin (issue #731)
  • Fixed parsing of findbugs files if Hudson is deployed in JBoss container (issue #1991)

Release 2.13:

  • Show spinner image during loading of tab content.
  • Added number of items in the label of a tab.

Release 2.12:

  • Added dynamic loading of the tab content in the detail pages.

Release 2.11:

Release 2.10:

  • Added different help texts for maven or freestyle configuration
  • Parsing of ant build.xml or maven pom.xml files is now only done if the build runs with the corresponding runner (issue #1898)
  • Ignore maven projects without target folder (issue #1813)
  • Reduced mermory footprint of parser (issue #1960)
  • Fixed NPE during computation of new warnings (issue #2093)
  • "Zero warnings since build #x" indicator should work correctly now (issue #1533)
  • Height of trend graph can be changed for the m2 project type, too (issue #2115)

Release 2.9:

  • New file overview page that shows the distribution per file
  • Added source code links to warnings table
  • Show line number of files in all warning detail views (issue #1974)
  • Improved layout (css) of the tabview

Release 2.8:

  • New result UI with drill-down and statistics of modules, packages, severities, categories, types, overview, details, fixed and new warnings
  • Added parsing of ANT build.xml files to extract the project name (issue #1560)
  • Improved parsing of Java files to extract the package name (issue #1828, issue #1829)

Release 2.7:

  • Fixed update of configuration if the FindBugs plug-in is used in conjunction with violations plug-in (report)
  • Fixed exception during parsing of FindBugs warnings of priority experimental (issue #1801)

Release 2.6:

  • Fixed backward compatibility with Hudson 1.180

Release 2.5:

  • Added m2 report aggregation of sub-modules and the main project (issue #1602,issue #1522)
  • Added expandable advanced section in plug-in configuration screen
  • Added customizable height of trend graph (to prevent scrolling on the main page)
  • Removed filename pattern for maven2 builds, since this information is retrieved from the pom
  • Fixed bug in trend report generation if build has been terminated without  creating the FindBugs results
  • Fixed issue #1560: Generate an unique module name if the pom.xml do contain duplicate names
  • Fixed issue #1500: Fixed wrong initialization of cookie (for trend report toggle graph)
  • Fixed issue #1547: Don't start publisher if build has been canceled

Release 2.4:

  • Added drill-down support for warning severities (issue #733)
  • Added support for fbcontrib plug-in (report)
  • Fixed issue #1468: Fixed broken trend reports during a running build
  • Fixed issue #1501: Replaced link to results of running build to results of last finished build
  • Added french localization for messages (thanks to Eric Lefevre)

Release 2.3:

  • Fixed issue #1479: don't use logger on remote machine

Release 2.2:

  • Added german localization for messages and views
  • Fixed missing bug patterns in m2 jobs (see report)
  • Upgrade to findbugs 1.3.2 to parse the XML files

Release 2.1:

  • Fixed issue #1259: trend graph update only for successful builds
  • Fixed issue #1380: high/low priorities are interchanged in trend graph

Release 2.0:

  • Replaced self-made parser with parser from the native FindBugs library
  • Support for findbugs-maven-plugin 1.2
  • Highlighting of single lines as well as line ranges
  • Highlighting of multiple line ranges per warning (different color for primary range)
  • Extraction of module/project names from FindBugs files
  • Added support for native m2 build option of Hudson
  • Errors during parsing are reported on an error screen (no build failures anymore)
  • Improved detection of source code files (for source highlighting)
  • Shows since which build we have zero warnings

Release 1.0-1.18

Labels

  Edit Labels
  1. Dec 06, 2007

    Anonymous says:

    HI,   I am trying to install the Findbugs plugin via Hudson GUI and am not ...

    HI,

      I am trying to install the Findbugs plugin via Hudson GUI and am not able to do so.I downloaded the findbugs.zip file, extracted it under a foler findbugs under Hudson/Plugins.

    How do I install this plugin?

    I have Hudson running on windows.

    Thanks

    Hans 

  2. Dec 06, 2007

    Anonymous says:

    The plugin is not in ZIP format. You should not try to unzip it. The plugin shou...

    The plugin is not in ZIP format. You should not try to unzip it. The plugin should download as .hpi file (if not, then the web server is not configured correctly). Try to rename the file from .zip to .hpi.
    --
    Ulli 

  3. Dec 07, 2007

    Anonymous says:

    Tahnks a lot Ulli.   That worked. I have downloaded several Plugins. All ha...

    Tahnks a lot Ulli.

      That worked. I have downloaded several Plugins. All have the extension .zip

    I will change the extensions to .hpi and use them

    WArm REgards

    Hans

  4. Dec 14, 2007

    Anonymous says:

    Hello,  does this work with maven2 project type or is it just for free styl...

    Hello,

     does this work with maven2 project type or is it just for free style? I cannot find any options in maven2 project.

    I use:

    - hudson v.1.160

    - findbugs plugin v.1.18

  5. Dec 18, 2007

    Anonymous says:

    The same with me. Installed plugin but does not seem to be activated in Hudson G...

    The same with me. Installed plugin but does not seem to be activated in Hudson GUI. Any hint ?

    Thank you,

    R

  6. Dec 20, 2007

    Anonymous says:

    For the record, me too.  The same with me. Installed plugin but does not s...

    For the record, me too.

     The same with me. Installed plugin but does not seem to be activated in Hudson GUI. Any hint ?

     does this work with maven2 project type or is it just for free style? I cannot find any options in maven2 project.


    ~ Mike 

  7. Dec 30, 2007

    Stephen Connolly says:

    This plugin does not currently work with the m2 project type

    This plugin does not currently work with the m2 project type

  8. Jan 15, 2008

    Anonymous says:

    Hi, I'm getting a double tool tip when I mouse over the highlighted text. Has an...

    Hi,

    I'm getting a double tool tip when I mouse over the highlighted text. Has anyone experienced this?

    Screen shot 

    Hudson v1.171

    FindBugs v1.18

    -> Sandro

    1. Jan 16, 2008

      Anonymous says:

      UPDATE:  The warning descriptions are also doubled; this is the page which ...

      UPDATE: 

      The warning descriptions are also doubled; this is the page which has links to the source.

      This bug appears in the findbugs plugin v1.18 only. I tried installing v1.17 and the issue went away. When I put v1.18 back in, it came back.

      Eagerly awaiting v1.19!  

      -> Sandro 

  9. Jan 18, 2008

    Anonymous says:

    Hi, I have some problem with running plugin (version 1.18) on my XML file genera...

    Hi, I have some problem with running plugin (version 1.18) on my XML file generated by FindBugs. I'm getting this NPE: FATAL: Could not parse FindBugs files. Please check if the file pattern is correct and the latest FindBugs scanner is used (i.e., maven-findbugs-plugin >= 1.1.1) java.lang.NullPointerException at org.apache.commons.digester.Digester.createSAXException(Digester.java:2919) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2945) at org.apache.commons.digester.Digester.endElement(Digester.java:1133) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at org.apache.commons.digester.Digester.parse(Digester.java:1666) at hudson.plugins.findbugs.FindBugsCounter.parseNativeFormat(FindBugsCounter.java:162) at hudson.plugins.findbugs.FindBugsCounter.parse(FindBugsCounter.java:74) at hudson.plugins.findbugs.FindBugsCounter.findBugs(FindBugsCounter.java:222) at hudson.plugins.findbugs.FindBugsPublisher.perform(FindBugsPublisher.java:89) at hudson.model.Build$RunnerImpl.performAllBuildStep(Build.java:150) at hudson.model.Build$RunnerImpl.post2(Build.java:137) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:254) at hudson.model.Run.run(Run.java:673) at hudson.model.Build.run(Build.java:102) at hudson.model.ResourceController.execute(ResourceController.java:70) at hudson.model.Executor.run(Executor.java:64) Thanks for any suggestions, Mike

    1. Jan 18, 2008

      Anonymous says:

      \sorry for last post, i had some troubles with javascripts and csss on this page...

      [sorry for last post, i had some troubles with javascripts and csss on this page, i'll try again:] 

      Hi, I have some problem with running plugin (version 1.18) on my XML file generated by FindBugs. I'm getting this NPE:FATAL: Could not parse FindBugs files. Please check if the file pattern is correct
      and the latest FindBugs scanner is used (i.e., maven-findbugs-plugin >= 1.1.1)
      java.lang.NullPointerException
      at org.apache.commons.digester.Digester.createSAXException(Digester.java:2919)
      at org.apache.commons.digester.Digester.createSAXException(Digester.java:2945)
      at org.apache.commons.digester.Digester.endElement(Digester.java:1133)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
      at org.apache.commons.digester.Digester.parse(Digester.java:1666)
      at hudson.plugins.findbugs.FindBugsCounter.parseNativeFormat(FindBugsCounter.java:162)
      at hudson.plugins.findbugs.FindBugsCounter.parse(FindBugsCounter.java:74)
      at hudson.plugins.findbugs.FindBugsCounter.findBugs(FindBugsCounter.java:222)
      at hudson.plugins.findbugs.FindBugsPublisher.perform(FindBugsPublisher.java:89)
      at hudson.model.Build$RunnerImpl.performAllBuildStep(Build.java:150)
      at hudson.model.Build$RunnerImpl.post2(Build.java:137)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:254)
      at hudson.model.Run.run(Run.java:673)
      at hudson.model.Build.run(Build.java:102)
      at hudson.model.ResourceController.execute(ResourceController.java:70)
      at hudson.model.Executor.run(Executor.java:64)Thanks for any suggestions,

        Mike

  10. Mar 06

    Gerald Reinhart says:

    specify \/findbugsXml.xml See issue 1369 https://hudson.dev.java.net/issues/show...

    specify **/findbugsXml.xml

    See issue 1369

  11. Mar 19

    Manik Surtani says:

    I just upgraded my Hudson instance (to 1.197) and installed the findbugs plugin ...

    I just upgraded my Hudson instance (to 1.197) and installed the findbugs plugin (ver 2.2), and all seems to have run well - the findbugs XML file was generated and I'm guessing it was picked up by the plugin - but I can't find any reports on the Hudson UI. 

    Where would one look to find this?  A screen shot on this wiki page would be supremely useful ...

    1. Apr 06

      Ulli Hafner says:

      What Information is shown in the log of the build? Which type of build are you u...

      What Information is shown in the log of the build? Which type of build are you using (m2 or freestyle?)

      BTW: Could you please discuss such issues in the mailing lists as I don't regularly check the comments on this page.

  12. May 16

    Lukasz says:

    getting "java.lang.NoClassDefFoundError: hudson/util/ChartUtil$NumberOnlyBuildLa...

    getting "java.lang.NoClassDefFoundError: hudson/util/ChartUtil$NumberOnlyBuildLabel"

    when using Hudson 1.215 and 2.6, 2.5 works fine.