tags:

views:

50

answers:

1

http://maven.apache.org/plugins/maven-pmd-plugin/ is currently in version 2.4 which supports PMD version 4.2.2

Is it possible to use PMD version 4.2.5 with this plugin, if so how do we do this?

+1  A: 

There is a Jira Issue for this, see MPMD-97 (I suggest to vote for it).

For now, you can try to upgrade locally the pmd version used in the plugin with:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.4</version>

        <dependencies>

          <dependency>
              <groupId>pmd</groupId>
              <artifactId>pmd-jdk14</artifactId>
              <version>4.2.5</version>
          </dependency>

        </dependencies>
      </plugin>
    </plugins>
  </build>

I didn't test this, I don't know if it'll work seamlessly.

Pascal Thivent
I am in the process of trying your suggestions, but I need support for JDK 1.5 (pmd-jdk14 makes it JDK 1.4 compliant)Making the above changes caused the plugin to retrive the newer version of the PMD, but it still kept generating a PMD 4.2.2 report. I am not sure why this is happening, but will keep you posted on the results.
Joshua
I did some testing on my side and it seems indeed that specifying `dependencies` for the plugin under `build` doesn't affect the `reporting` section. However, it's not possible to specify dependencies under `reporting` so I actually don't know how to solve this (except by patching the maven-pmd-plugin).
Pascal Thivent
Yes, reporting section doesn't allow you to specify dependencies. I kind of moved this configuration inside build-->pluginManagement-->plugins-->plugin, but I am verifying to see if I can get this working as part of the build phase
Joshua
I am unable to get this working with the suggestion mentioned above, it still seems to generate only a PMD 4.2.2 report
Joshua