You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Grzegorz Słowikowski <gs...@gmail.com> on 2007/04/20 10:33:56 UTC

Controlling plugin versions using dependency management

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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Controlling plugin versions using dependency management

Posted by Grzegorz Słowikowski <gs...@gmail.com>.
Thank you

Grzegorz Slowikowski

Franz Allan Valencia See napisał(a):
> Good day,
>
> Use <pluginMangement/> instead. Something like
>
> <project>
>  ...
>  <build>
>    <pluginManagement>
>      <plugins>
>        <plugin>
>          <!--
>            if you don't specify a groupId, org.apache.maven.plugins is 
> used.
>          -->
>          <groupId>org.apache.maven.plugins</groupId>
>          <artifactId>maven-jar-plugin</artifactId>
>          <version>2.0</version>
>        </plugin>
>      </plugins>
>    </pluginManagement>
>  </build>
> </project>
>
> See [1] for more info.
>
> Cheers,
> Franz
>
> [1] http://maven.apache.org/ref/current/maven-model/maven.html
>
> On 4/20/07, Grzegorz Słowikowski <gs...@gmail.com> wrote:
>> 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: 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: Controlling plugin versions using dependency management

Posted by Franz Allan Valencia See <fr...@gmail.com>.
Good day,

Use <pluginMangement/> instead. Something like

<project>
  ...
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <!--
            if you don't specify a groupId, org.apache.maven.plugins is used.
          -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

See [1] for more info.

Cheers,
Franz

[1] http://maven.apache.org/ref/current/maven-model/maven.html

On 4/20/07, Grzegorz Słowikowski <gs...@gmail.com> wrote:
> 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: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Controlling plugin versions using dependency management

Posted by Grzegorz Słowikowski <gs...@gmail.com>.
Thank you.

I thought, pluginManagement is for plugin configurations and all other 
stuff but versions, and dependencyManagement
for artifact/plugin versions managing. I was wrong.

Grzegorz Slowikowski

LAMY Olivier napisał(a):
> Hi,
> In your root pom, use build/pluginManagement/plugins with this :
>
>         <plugin>
>           <artifactId>maven-jar-plugin</artifactId>
>           <version>2.0</version>
>         </plugin> 
>  
> And maybe use user ML for this question.
>
> --
> Olivier
>
> -----Message d'origine-----
> De : Grzegorz Słowikowski [mailto:gslowikowski@gmail.com] 
> Envoyé : vendredi 20 avril 2007 10:34
> À : dev@maven.apache.org
> Objet : Controlling plugin versions using dependency management
>
> 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: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org
>
>
> This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
> --------------------------------------------------------------------------------------------------------------
> Ce message électronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites.
> -------------------------------------------------------------------------------------------------------------
>
>   

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


RE: Controlling plugin versions using dependency management

Posted by LAMY Olivier <Ol...@accor.com>.
Hi,
In your root pom, use build/pluginManagement/plugins with this :

        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.0</version>
        </plugin> 
 
And maybe use user ML for this question.

--
Olivier

-----Message d'origine-----
De : Grzegorz Słowikowski [mailto:gslowikowski@gmail.com] 
Envoyé : vendredi 20 avril 2007 10:34
À : dev@maven.apache.org
Objet : Controlling plugin versions using dependency management

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: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org


This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
--------------------------------------------------------------------------------------------------------------
Ce message électronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites.
-------------------------------------------------------------------------------------------------------------