Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make maven-pmd-plugin support the latest PMD release?

Tags:

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?

like image 527
Joe Avatar asked Jan 09 '10 11:01

Joe


People also ask

Does Maven allow third party plugins?

However, as previously mentioned, the user may have a need for third-party plugins. Since the Maven project is assumed to have control over the default plugin groupId, this means configuring Maven to search other groupId locations for plugin-prefix mappings. As it turns out, this is simple.

How do I skip a PMD violation?

Is there any way to skip the PMD or CPD reports temporarily? Yes, each report supports a skip parameter which you can pass on the command line, -Dpmd. skip=true and -Dcpd. skip=true respectively.

What is PMD Maven plugin?

The PMD Plugin allows you to automatically run the PMD code analysis tool on your project's source code and generate a site report with its results. It also supports the separate Copy/Paste Detector tool (or CPD) distributed with PMD. This version of Maven PMD Plugin uses PMD 6.49.


1 Answers

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.

like image 168
Pascal Thivent Avatar answered Oct 12 '22 07:10

Pascal Thivent