You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Amir Eliaz <am...@mailvision.com> on 2008/04/17 13:51:31 UTC

Maven PMD plugin dependency on pmd Jar is out of date

Hello,
   Looking in
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-pmd-plugin/2.3/maven-pmd-plugin-2.3.pom
I found out it depends on pmd-jdk14-4.1.1.jar
Now, this Jar does not contain net.sourceforge.pmd.rules
.basic.AvoidMultipleUnaryOperators
but the plugin implementation is looking for it.
But, if your use pmd-4.2.1.jar (from
http://repo1.maven.org/maven2/pmd/pmd/4.2.1)
instead of pmd-jdk14-4.1.1.jar (by manually replacing in ~/.m2/repository),
the class is found and everything works.
So the problem really is a wrong dependency in maven-pmd-plugin-2.3.pom,
which is the latest for this plugin.

FYI
--Amir

RE: Maven PMD plugin dependency on pmd Jar is out of date

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
FWIW, in 2.0.9 you can override the plugin dependency and force a newer
version of the PMD jar (provided the api is compatible of course)

-----Original Message-----
From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu] 
Sent: Friday, April 18, 2008 3:08 PM
To: dev@maven.apache.org
Subject: Re: Maven PMD plugin dependency on pmd Jar is out of date


Amir Eliaz wrote:
> So the problem really is a wrong dependency in
maven-pmd-plugin-2.3.pom,
> which is the latest for this plugin.

The dependency in general is not wrong, it's just inappropriate for
users
that would like to use newer rules.

The SVN head has just been updated to use 4.2.1 (see
http://jira.codehaus.org/browse/MPMD-78). Until the PMD Plugin 2.4 gets
released, the following should solve your problem:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.3</version>
        <dependencies>
          <dependency>
            <groupId>pmd</groupId>
            <artifactId>pmd-jdk14</artifactId>
            <version>4.2.1</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
  ...
</project>

i.e. overwrite the plugin class path with the PMD version your require.
Note
that this must be done using <build>, there is no <dependencies> element
under <reporting>.


Benjamin
-- 
View this message in context:
http://www.nabble.com/Maven-PMD-plugin-dependency-on-pmd-Jar-is-out-of-d
ate-tp16746339s177p16764207.html
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven PMD plugin dependency on pmd Jar is out of date

Posted by Benjamin Bentmann <be...@udo.edu>.
Amir Eliaz wrote:
> So the problem really is a wrong dependency in maven-pmd-plugin-2.3.pom,
> which is the latest for this plugin.

The dependency in general is not wrong, it's just inappropriate for users
that would like to use newer rules.

The SVN head has just been updated to use 4.2.1 (see
http://jira.codehaus.org/browse/MPMD-78). Until the PMD Plugin 2.4 gets
released, the following should solve your problem:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.3</version>
        <dependencies>
          <dependency>
            <groupId>pmd</groupId>
            <artifactId>pmd-jdk14</artifactId>
            <version>4.2.1</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
  ...
</project>

i.e. overwrite the plugin class path with the PMD version your require. Note
that this must be done using <build>, there is no <dependencies> element
under <reporting>.


Benjamin
-- 
View this message in context: http://www.nabble.com/Maven-PMD-plugin-dependency-on-pmd-Jar-is-out-of-date-tp16746339s177p16764207.html
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven PMD plugin dependency on pmd Jar is out of date

Posted by Xavier Le Vourch <xa...@brittanysoftware.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I saw your message on the pmd developer forum and on the maven lists.
Based on the forum post, you are using a custom ruleset that references
the AvoidMultipleUnaryOperators rule. That rule was introduced in pmd
4.2 and is not in pmd 4.1 nor is it referenced in the rulesets that ship
with pmd 4.1.

So the issue is not with the pmd plugin packaging but with how your
custom ruleset references a newer rule that is not available yet from
the pmd plugin.


Best regards,

Xavier Le Vourch


Amir Eliaz wrote:
| Hello,
|    Looking in
|
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-pmd-plugin/2.3/maven-pmd-plugin-2.3.pom
| I found out it depends on pmd-jdk14-4.1.1.jar
| Now, this Jar does not contain net.sourceforge.pmd.rules
| .basic.AvoidMultipleUnaryOperators
| but the plugin implementation is looking for it.
| But, if your use pmd-4.2.1.jar (from
| http://repo1.maven.org/maven2/pmd/pmd/4.2.1)
| instead of pmd-jdk14-4.1.1.jar (by manually replacing in
~/.m2/repository),
| the class is found and everything works.
| So the problem really is a wrong dependency in maven-pmd-plugin-2.3.pom,
| which is the latest for this plugin.
|
| FYI
| --Amir
|


- --
Xavier Le Vourch
Brittany Software, Inc.
<xa...@brittanysoftware.com>

PGP Key (ID 0x896C5947): http://brittanysoftware.com/gpg_key.asc
Key fingerprint: 73B3 6370 B8C5 4325 F2D8  4115 0372 5805 896C 5947
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIB4HqA3JYBYlsWUcRApV7AKCPLhVhzfpz/tT3ZTwy01MZ3V4cBQCfeH/g
iAroUW6tI2W6F/DEGmH78XE=
=l+Fk
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven PMD plugin dependency on pmd Jar is out of date

Posted by Dennis Lundberg <de...@apache.org>.
Hi

Can you please file this in JIRA [1], otherwise it might get lost in the 
traffic. Please include a sample project (if you can) and the complete 
output log that you get.

Note that maven-pmd-plugin requires a pmd jar file that can be used with 
Java 1.4, hence the "jdk14" classifier.

[1] http://jira.codehaus.org/browse/MPMD

Amir Eliaz wrote:
> Hello,
>    Looking in
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-pmd-plugin/2.3/maven-pmd-plugin-2.3.pom
> I found out it depends on pmd-jdk14-4.1.1.jar
> Now, this Jar does not contain net.sourceforge.pmd.rules
> .basic.AvoidMultipleUnaryOperators
> but the plugin implementation is looking for it.
> But, if your use pmd-4.2.1.jar (from
> http://repo1.maven.org/maven2/pmd/pmd/4.2.1)
> instead of pmd-jdk14-4.1.1.jar (by manually replacing in ~/.m2/repository),
> the class is found and everything works.
> So the problem really is a wrong dependency in maven-pmd-plugin-2.3.pom,
> which is the latest for this plugin.
> 
> FYI
> --Amir
> 


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org