Hi all,

I would like my POM to dictate the versions of the plugins to be used.
I'm seeing strange things, though. Sometimes Maven abides by the
version number I've configured, sometimes not. Below is the smallest
POM I could create that displays the kind of problem I'm talking
about.

<project
       xmlns="http://maven.apache.org/POM/4.0.0";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";

       <modelVersion>4.0.0</modelVersion>
       <groupId>x</groupId>
       <artifactId>y</artifactId>
       <version>1.0</version>
       <build>
               <pluginManagement>
                       <plugins>
                               <plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-pmd-plugin</artifactId>
                                       <version>2.0</version>
                               </plugin>
                       </plugins>
               </pluginManagement>
       </build>
       <reporting>
               <plugins>
                       <plugin>
                               <groupId>org.apache.maven.plugins</groupId>
                               <artifactId>maven-pmd-plugin</artifactId>
                       </plugin>
               </plugins>
       </reporting>
</project>

Now try: mvn -X pmd:check | grep maven-pmd-plugin

[DEBUG] Retrieving parent-POM:
org.apache.maven.plugins:maven-plugins::1 for project:
null:maven-pmd-plugin:maven-plugin:2.0 from the repository.
[DEBUG] org.apache.maven.plugins:maven-pmd-plugin:maven-plugin:2.0:runtime
(selected for runtime)
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-pmd-plugin:2.0:pmd' -->
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-pmd-plugin:2.0:check' -->

Ok, this is what I was expecting to see.

But now try: mvn -X site | grep maven-pmd-plugin

[DEBUG] maven-pmd-plugin: resolved to version 2.1-SNAPSHOT from local repository
[DEBUG] maven-pmd-plugin: using locally installed snapshot
[DEBUG] Retrieving parent-POM:
org.apache.maven.plugins:maven-plugins::1 for project:
null:maven-pmd-plugin:maven-plugin:2.1-SNAPSHOT from the repository.
[DEBUG] maven-pmd-plugin: using locally installed snapshot
[DEBUG] 
org.apache.maven.plugins:maven-pmd-plugin:maven-plugin:2.1-SNAPSHOT:runtime
(selected for runtime)
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-pmd-plugin:2.1-SNAPSHOT:pmd' -->
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-pmd-plugin:2.1-SNAPSHOT:cpd' -->

(I have compiled a few plugins from the Maven Subversion repository.)

Why don't I get the version I've asked for? Why is this different?

Cheers,
Hilco

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to