You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2013/01/28 23:22:15 UTC

Maven Plugin - plugin version based on pluginManagement

Hi there,

currently i'm working on a new maven plugin
http://khmarbaise.github.com/itexin-maven-plugin/usage.html
which will make it possible to execute a plugin several times based on
values (iteration).

But my question is related how to get the information about a plugins 
version of a defined pluginManagement section...for example:

If i define:

   <build>
     <pluginManagement>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>3.0</version>
         </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
   </plugins>
</build>

So the question is how does Maven know of the version of the above 
plugin which has been defined in the pluginManagement section before.

Is there solution to get this kind of information during the run of 
plugin itself ?

I have the given configuration in my plugin like this:

     @Parameter(required = true)
     private Plugin plugin;

But if i like to omit the version it will fail.
So the question is how can i get a version of a plugin which has been 
defined by a pluginManagement block before...

Someone an hint/idea ?

Many thanks in advance.

Kind regard.
Karl-Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl-Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

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


Re: Maven Plugin - plugin version based on pluginManagement

Posted by Hervé BOUTEMY <he...@free.fr>.
Le lundi 28 janvier 2013 23:22:15 Karl Heinz Marbaise a écrit :
> So the question is how does Maven know of the version of the above
> plugin which has been defined in the pluginManagement section before.
see maven-model-builder, phase 2, "plugin management injection" step [1], done 
in code [2] by DefaultPluginManagementInjector [3]

> 
> Is there solution to get this kind of information during the run of
> plugin itself ?
previous code should give you hints

> 
> I have the given configuration in my plugin like this:
> 
>      @Parameter(required = true)
>      private Plugin plugin;
> 
> But if i like to omit the version it will fail.
> So the question is how can i get a version of a plugin which has been
> defined by a pluginManagement block before...
> 
> Someone an hint/idea ?
> 
> Many thanks in advance.
> 
> Kind regard.
> Karl-Heinz Marbaise

[1] http://maven.apache.org/ref/3.1-SNAPSHOT/maven-model-builder/

[2] http://maven.apache.org/ref/3.1-SNAPSHOT/maven-model-
builder/xref/org/apache/maven/model/building/DefaultModelBuilder.html#381

[3] http://maven.apache.org/ref/3.1-SNAPSHOT/maven-model-
builder/xref/org/apache/maven/model/management/DefaultPluginManagementInjector.html

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