-
Can the release notes specify if the release candidates are supported by Maven PMD Plugin? |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 28 replies
-
maven-pmd-plugin 3.20.0/3.21.0 does indeed not support PMD 7. As this is a major version change, there are a couple of incompatibilities. See https://issues.apache.org/jira/browse/MPMD-379. There is a snapshot version available, that supports this. We use it in our CI build.
If you want to use it, you need to add apache's snapshot repo: <pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>https://repository.apache.org/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository> This SNAPSHOT is built from that branch: https://github.com/apache/maven-pmd-plugin/tree/pmd7 I didn't have time yet to make it production ready... |
Beta Was this translation helpful? Give feedback.
-
I'm encountering errors below while executing the Maven PMD Plugin Snapshot:
I don't see these while executing the Ant task against 7.0.0-rc1. Am I to assume that's because the development pmd jars are also bundled with the Maven plugin? |
Beta Was this translation helpful? Give feedback.
-
It seems these rules have been updated since for PMD 7. No probs. I will have to check why Ant didn't flag an error. |
Beta Was this translation helpful? Give feedback.
-
With Ant and Ivy, I'm getting the following error for the pmd-cli compile dependencies:
The 7.0.0-SNAPSHOT for pmd-ui is not available on Maven repo. Is there some configuration for ivy that I need to set up? |
Beta Was this translation helpful? Give feedback.
-
Can Ivy be configured to download it from https://oss.sonatype.org/content/repositories/snapshots/? |
Beta Was this translation helpful? Give feedback.
-
I was able to use maven-pmd-plugin 3.21.0 after applying the following changes to PMD 7.0.0-SNAPSHOT: #4609 |
Beta Was this translation helpful? Give feedback.
-
Here is now the new solution for PMD 7.0.0-rc4 and later: In order to use PMD 7 with maven-pmd-plugin a new
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-compat6</artifactId>
<!--<version>${pmdVersion}</version>-->
<version>7.0.0-rc4+with-pr4749</version> <!-- this contains the fix from #4749 -->
</dependency> It is important to add this dependency as the first in the list, so that maven-pmd-plugin sees the (old) This module is available beginning with version 7.0.0-rc4 and will be there at least for the first Note: This compatibility module only works for the built-in rules, that are still available in PMD 7. E.g. you need As PMD 7 revamped the Java module, if you have custom rules, you need to migrate these rules. |
Beta Was this translation helpful? Give feedback.
-
@adangel Thanks for working on this! Unfortunately, I'm still getting an error when trying to build junixsocket with the updated configuration:
|
Beta Was this translation helpful? Give feedback.
-
I really dont understand what I'm doing wrong, but I can't get past this error ...
could anyone help? this is my setup
|
Beta Was this translation helpful? Give feedback.
-
I'm seeing this error [ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.21.2:pmd (default-cli) on project data: Execution default-cli of goal org.apache.maven.plugins:maven-pmd-plugin:3.21.2:pmd failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-pmd-plugin:3.21.2:pmd: java.lang.NoSuchMethodError: 'java.lang.String net.sourceforge.pmd.Report$ProcessingError.getFile()' |
Beta Was this translation helpful? Give feedback.
Here is now the new solution for PMD 7.0.0-rc4 and later:
In order to use PMD 7 with maven-pmd-plugin a new
compatibility module has been created. This allows to use PMD 7 by simply adding one additional dependency:
It is important to add this dependency as the first in the list, so that maven-pmd-plugin sees the (old)
compatible versions of some classes.
This module is ava…