Name

PMD plugin

Version

2.1.3

Product Versions

1.2.x/2.x

Author(s)

Ross Rowe

Homepage

http://confluence.atlassian.com/display/CODEGEIST/PMD+plugin

Price

Free

License

BSD

JavaDocs

See pmd_bamboo.zip

IssueTracking

http://developer.atlassian.com/jira/browse/PMD

Subversion URL

https://svn.atlassian.com/svn/public/contrib/bamboo/bamboo-pmd-plugin

or browse via fisheye

Download JAR

pmd_bamboo-1.0.7.jar (supports 1.2.x)/pmd_bamboo-2.0.3.jar (supports 2.0.x)/pmd_bamboo-2.1.3.jar (supports 2.1.x)

Download Source

pmd_bamboo.zip

Description/Features

A plugin that will parse and record PMD static analysis reports

Upgrading to Bamboo 2.1

The 2.0.3 version of the PMD plugin is not compatible with Bamboo 2.1. If you are upgrading from Bamboo 2.0 to 2.1, then you will also need to use the latest version of the PMD plugin

Usage

  1. Copy the pmd_bamboo-2.1.2.jar 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 PMD section on the 'Builder Configuration' tab. Here you can specify whether your plan generates PMD reports, and if so, the location of the XML report file.
  3. That should be it, you should now see a PMD tab on your Plan and on any new builds that generate PMD report files.

Feel free to contact me if you've got any comments/queries about the plugin!

Jira Issues

type key summary reporter status

Data cannot be retrieved due to an unexpected error.

View these issues in Jira

Version History

Version

Date

Description

2.1.3

22 Aug 2009

Updated plugin to support Bamboo 2.3

2.1.2

29 Jan 2009

Included priority 4 violations in output(PMD-15)

2.1.1

9 August 2008

Updated chart to display separate violation priorities(PMD-12)

2.1.0

8 August 2008

Recompiled plugin to support Bamboo 2.1

1.0.7

7 April 2008

Ensured delta is correctly calculated from multiple result files (PMD-10)

1.0.6

15 November 2007

Removed % symbol from results page (PMD-8)

1.0.5

26 July 2007

Resolved error that affected display of Authors page

1.0.4

24 July 2007

Ensured violation counts get appended rather than replaced when processing multiple files

1.0.3

16 July 2007

Fixed IndexOutOfBoundsException

1.0.2

16 July 2007

Updated to support Bamboo 1.2

1.0.0

12 May 2007

Final version for submission

0.9.1

8 May 2007

Show the classes with the most violations on the build results page

0.9.0

25 April 2007

Initial stable version

Screenshots

29 Comments

  1. Just FYI, I've released version 1.0.1 in response to PMD-1.

    The 1.0.1 jar file can be obtained from http://developer.atlassian.com/jira/secure/attachment/10611/pmd_bamboo-1.0.1.jar

  2. This does not work with Bamboo 1.2?

     My log says

    INFO   | jvm 1    | 2007/07/11 21:06:16 | 2007-07-11 21:06:16,250 ERROR [WrapperSimpleAppMain] [DefaultPluginManager] There was an error loading the descriptor 'View PMD Result' of plugin 'com.atlassian.bamboo.plugins.pmd'. Disabling.
    INFO   | jvm 1    | 2007/07/11 21:06:16 | java.lang.NoClassDefFoundError: com/atlassian/bamboo/build/AbstractBuildAction
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.lang.ClassLoader.defineClass1(Native Method)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.lang.ClassLoader.defineClass(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.security.SecureClassLoader.defineClass(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.net.URLClassLoader.defineClass(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.net.URLClassLoader.access$000(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.net.URLClassLoader$1.run(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.security.AccessController.doPrivileged(Native Method)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.net.URLClassLoader.findClass(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.lang.ClassLoader.loadClass(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.lang.ClassLoader.loadClass(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:211)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:195)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.opensymphony.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:96)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.opensymphony.xwork.ObjectFactory.getClassInstance(ObjectFactory.java:88)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.opensymphony.xwork.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:175)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.opensymphony.xwork.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:116)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.opensymphony.xwork.ObjectFactory.buildAction(ObjectFactory.java:101)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.plugin.descriptor.XWorkModuleDescriptor.addAction(XWorkModuleDescriptor.java:262)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.plugin.descriptor.XWorkModuleDescriptor.getPackages(XWorkModuleDescriptor.java:107)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.plugin.descriptor.XWorkModuleDescriptor.getPackages(XWorkModuleDescriptor.java:478)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.plugin.descriptor.XWorkModuleDescriptor.init(XWorkModuleDescriptor.java:457)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.opensymphony.xwork.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:85)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.plugin.descriptor.XWorkModuleDescriptor.enabled(XWorkModuleDescriptor.java:61)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.plugin.DefaultPluginManager.addPlugin(DefaultPluginManager.java:274)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.plugin.DefaultPluginManager.init(DefaultPluginManager.java:72)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.container.BambooContainer.init(BambooContainer.java:157)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.container.BambooContainer.initialise(BambooContainer.java:124)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.upgrade.UpgradeLauncher.initialiseBambooContainer(UpgradeLauncher.java:149)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.upgrade.UpgradeLauncher.upgradeAndStartBamboo(UpgradeLauncher.java:94)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.upgrade.UpgradeLauncher.contextInitialized(UpgradeLauncher.java:37)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:497)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.mortbay.jetty.plus.PlusWebAppContext.doStart(PlusWebAppContext.java:149)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.mortbay.util.Container.start(Container.java:72)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.mortbay.http.HttpServer.doStart(HttpServer.java:753)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.mortbay.jetty.plus.Server.doStart(Server.java:153)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.mortbay.util.Container.start(Container.java:72)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at com.atlassian.bamboo.server.Server.main(Server.java:58)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.lang.reflect.Method.invoke(Unknown Source)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
    INFO   | jvm 1    | 2007/07/11 21:06:16 |     at java.lang.Thread.run(Unknown Source)  

    And when you trace the file and yes - its not there anymore in  atlassian-bamboo-web 1.2.

  3. Many thank to Ross for fixing the incomatibility with Bamboo 1.2 in the PMD 1.0.2 release.
         
     

  4. I've installed the plugin on two instances of bamboo. On one it works like a charm on the other, the build report works, but the project plan PMD summary graph shows all zeros.  Any ideas ?

  5. Same problem here... anyone ?

    1. Would you be able to raise a Jira issue (at http://developer.atlassian.com/jira/browse/PMD), and provide me with some information on the version of Bamboo you're running, plus the PMD report file if possible, so that I can try to replicate it?

      Thanks,

      Ross

  6. Are there any plans to move this to Bamboo 2?

    1. Yes, version 2.0.3 should already support Bamboo 2.0

  7. it would be really nice if the chart could distinguish between priorities. one graph line per one priority level. regards

    1. Hi Dominik, sounds like a good idea, I've raised this as an issue (PMD-12, hopefully I'll be able to get around to looking at this sometime soon.

      Cheers,

      Ross

      1. Hi again, I've updated the chart to display the counts for the separate priorites, which is now available in version 2.1.1.

        Cheers,

        Ross

  8. Hi guys,

    Tanks for the really cool plugin Ross!

    I do seem to experience a minor issue though... I cant really see most of the screenshots though.

    We are running Bamboo 2.0.6 build 808 and plugin version 2.0.3.

    I can see the violation over time graph but thats about it, none of the cooler summary stats that you screens show (sad) .

    Could it be that a bamboo upgrade is needed for this?

    Cheers!

    Henrik

    1. Hi Henrik, I'm not sure why the PMD information isn't appearing...it might be because the plugin can't find the PMD report XML files? Would you be able to send me a copy (to piaross@gmail.com) of your bamboo.log file so that I can take a look? The latest version of the plugin supports Bamboo 2.1, so you might want to give that a shot too.

      Thanks,

      Ross

  9. Great plugin, wich shows nice overall information covering multiple builds. However the graph showing the PMD ups and downs between the builds is missing the number of PMD violations on the Y axis. Further more it shows the differences between weeks (7 days), not days (as shown in the screenshots). Of course it is usefull to see progress between weeks, but it would also be usefull to see differences between days and even months. Hope these features can be implemented over time.

    1. Thanks for the feedback...I looked into the display of the PMD graphs a while ago, and I think the behaviour you mentioned was a 'feature' of the underlying graphing libraries used by Bamboo. However, I'll try to take another look at it.

      Thanks,

      Ross

      1. "Fixed" the Y-axis problem. When there's only one violation, there's no need for a y axis (I guess there's no such thing as a 0,5 violation (big grin) )

  10. Hi,

    Is there a way to prevent the PMDBuildProcessor to resolve doctype in xml files ?

    Cause it generates many many errors trying to find unreachable dtds and urls.

    Thanks

    Math

    1. Hi Mathieu, yep it should be do-able, I've raised PMD-16 to cover the change.

      Cheers,

      Ross

  11. Do we need a new build of this plugin to use it with Bamboo 2.2.x?

    1. Hi Ryan, I'm pretty sure the latest version of the plugin supports Bamboo 2.2, but I'll double check and let you know.

      Cheers,

      Ross

    2. Hi again, I've just checked my environment, and the latest build of the PMD plugin seems to work okay with Bamboo 2.2.x.

      Cheers,

      Ross

      1. Thanks for looking into that Ross.

        -Ryan

  12. user-af67b

    Is it possible to add CPD into the mix? And possible allow CPD-only integration? For example, we have a C++/Python project in our Bamboo - and it would be great to just see the CPD output, without all the java analytics.

    1. Hi Evgeny, yep, it should be possible to add support for CPD, would you be able to raise a Jira issue for this functionality?

      Thanks,

      Ross

  13. Hi,

    with Bamboo 2.3 we get the error

    Failed to execute plugin 'PMD Build Processor' with error: com.atlassian.bamboo.v2.build.BuildPlanDefinition.getRepository()Lcom/atlassian/bamboo/v2/build/repository/RepositoryV2;
    

    Thomas

    1. Hi Thomas, version 2.1.3 should work okay with Bamboo 2.3.

      Cheers,

      Ross

      1. Hi Ross,

        Version 2.1.3 of the pmd plugin appears to not be backwards-compatible.  When I installed it on our Bamboo 2.1.4 instance, the build log showed the following:

        Failed to execute plugin 'PMD Build Processor' with error: com.atlassian.bamboo.v2.build.BuildPlanDefinition.getRepositoryV2()Lcom/atlassian/bamboo/v2/build/repository/RepositoryV2;
        

        I downgraded the pmd plugin to version 2.1.2, and it ran fine.

        Thanks for your work on this plugin!

        -Matt

  14. Ross,

    Version 2.1.3 is causing Bamboo to fail startup on Bamboo 2.3.1 build 1402 with the following:

    INFO   | jvm 1    | 2009/11/20 15:17:46 | 2009-11-20 15:17:46,369 INFO [WrapperSimpleAppMain] [log] Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
    INFO   | jvm 1    | 2009/11/20 15:17:46 | 2009-11-20 15:17:46,417 INFO [WrapperSimpleAppMain] [log] jetty-6.1.15
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 2009-11-20 15:17:47,033 WARN [WrapperSimpleAppMain] [log] Failed startup of context org.mortbay.jetty.webapp.WebAppContext@ad8659{/,../webapp}
    INFO   | jvm 1    | 2009/11/20 15:17:47 | java.util.zip.ZipException: error in opening zip file
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at java.util.zip.ZipFile.open(Native Method)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at java.util.zip.ZipFile.<init>(ZipFile.java:114)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at java.util.jar.JarFile.<init>(JarFile.java:133)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at java.util.jar.JarFile.<init>(JarFile.java:97)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.mortbay.jetty.webapp.TagLibConfiguration.configureWebApp(TagLibConfiguration.java:171)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1236)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:466)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.mortbay.jetty.Server.doStart(Server.java:222)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at com.atlassian.bamboo.server.Server.main(Server.java:60)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at java.lang.reflect.Method.invoke(Method.java:597)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:197)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 	at java.lang.Thread.run(Thread.java:619)
    INFO   | jvm 1    | 2009/11/20 15:17:47 | 2009-11-20 15:17:47,037 INFO [WrapperSimpleAppMain] [log] Started SocketConnector@0.0.0.0:8085

    Removing the plugin solves the problem, but obviously this isn't a solution.

    Thanks in advance!

    1. Hi, I've just recompiled the plugin, could you let me know if it fixes the problem?

      Thanks,

      Ross