Hi developers
I want to control plugin versions used in a multimodule build
with dependencyManagement. I thing, Maven behaves weird.
Here is a test project, where I try to control maven-jar-plugin version.
parent pom:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>mycompany</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<modules>
<module>child</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
child pom (in "child" subdirectory):
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>mycompany</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>child</artifactId>
<version>1.0.0-SNAPSHOT</version>
<!--
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</dependency>
</dependencies>
-->
</project>
When building child, maven-jar-plugin 2.1 (latest) is selected.
If I uncomment "dependencies" section, maven-jar-plugin 2.0
(specified in "dependencyManagement" section) is selected.
Why I have to specify dependency to make "dependencyManagement"
work for a plugin?
Is this an error or am I doing something wrong?
Greetings
Grzegorz Slowikowski
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]