[ 
http://jira.codehaus.org/browse/MNG-4727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=228157#action_228157
 ] 

Wim Deblauwe commented on MNG-4727:
-----------------------------------

Is there somebody who can give me a clue on where to look in the 2.2.x codebase 
to implement this? I suppose the plugin definitions are added to a 
{{Collection}} somewhere. If I could change that into a TreeSet for example 
with sorting on the id, this would do the trick I suppose.
As I know nothing of the Maven internals, maybe it is implemented totally 
different, that makes this hard to do?

> Allow ordering plugin execution via <id/>
> -----------------------------------------
>
>                 Key: MNG-4727
>                 URL: http://jira.codehaus.org/browse/MNG-4727
>             Project: Maven 2 & 3
>          Issue Type: Improvement
>    Affects Versions: 2.2.1
>            Reporter: Wim Deblauwe
>            Assignee: Benjamin Bentmann
>
> I would like to be able to deterministically order the execution of plugins 
> bound to the same lifecycle phase. I have a project where I need to execute 
> the antrun plugin, then the install4j-maven-plugin, again the antrun plugin 
> and finally the rpm-maven-plugin.
> I would like to be able to do this:
> {code:xml}
> <plugin>
>   <artifactId>maven-antrun-plugin</artifactId>
>   <version>1.4</version>
>   <executions>
>     <execution>
>       <id>step-1-extract-tomcat6x</id>
>       <phase>package</phase>
>       <goals><goal>run</goal></goals>
>       <configuration>
>           ...
>       </configuration>
>     </execution>
>     <execution>
>       <id>step-3-extract-install4j-tar-gz-file</id>
>       <phase>package</phase>
>       <goals><goal>run</goal></goals>
>       <configuration>
>            ...
>       </configuration>
>     </execution>
>   </executions>
> </plugin>
> <plugin>
>   <groupId>com.google.code.maven-install4j</groupId>
>   <artifactId>maven-install4j-plugin</artifactId>
>   <version>0.2-mvn-2.2.1</version>
>   <executions>
>     <execution>
>       <id>step-2-build-installers</id>
>       <phase>package</phase>
>       <goals><goal>compile</goal></goals>
>     </execution>
>   </executions>
>   <configuration>
>        ...
>   </configuration>
> </plugin>
> <plugin>
>   <groupId>org.codehaus.mojo</groupId>
>   <artifactId>rpm-maven-plugin</artifactId>
>   <version>2.1-alpha-1</version>
>   <executions>
>     <execution>
>       <id>step-4-create-rpm</id>
>       <phase>package</phase>
>       <goals><goal>attached-rpm</goal></goals>
>     </execution>
>   </executions>
>   <configuration>
>        ...
>   </configuration>
> </plugin>
> {code}
> When defined like this, the execution order should be:
> # step-1-extract-tomcat6x
> # step-2-build-installers
> # step-3-extract-install4j-tar-gz-file
> # step-4-create-rpm
> With the current maven (2.2.1), you can do this if you order your plugins in 
> the pom.xml correctly and you don't need the same plugin twice. Depending on 
> the {{<id/>}} (with natural sorting on String) would allow to declare the 
> same plugin twice.
> An alternative might be to add an additional element to {{<execution/>}}, 
> like {{<order/>}} or something that only accepts a number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to