You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bernhard David <da...@elca.ch> on 2008/04/16 08:43:43 UTC

Order of executing plugins changed in 2.0.9 ?

Hello,

in maven 2.0.8 I can put the following in a pom to execute first
cargo:start then cargo:deploy in the pre-integration-test phase. In
2.0.9, maven executes deploy first, which breaks the build. Declaring
the plugin once and having two <goal> entries in the <goals> doesn't
help.

<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
	<execution>
		<id>start-container</id>
		<phase>pre-integration-test</phase>
		<goals>
			<goal>start</goal>
		</goals>
	</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
	<execution>
		<id>deploy</id>
		<phase>pre-integration-test</phase>
		<goals>
			<goal>deploy</goal>
		</goals>
	</execution>
</executions>
</plugin>

**********

Shouldn't an entry like

<goals>
	<goal>start</goal>
	<goal>deploy</goal>
</goals>

force maven to do start first, then deploy? Is there a way to influence
this - or, what are the rules for execution order of plugins in a phase?

David

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


Re: What is the syntax to retrieve a system property value form a pom?

Posted by Wayne Fay <wa...@gmail.com>.
No such property exists, unless you've added the buildnumber plugin to
your build:
http://mojo.codehaus.org/buildnumber-maven-plugin/

Wayne

On 4/16/08, Tawfik, Sameh E <Sa...@fairisaac.com> wrote:
>
> Hi,
>
> What is the syntax to use from inside a pom.xml file to retrieve the
> value of the system date on Windows XP?
>
> I need to update the following parameter with the Build-date value. I
> tried ${env.date} but it did not work?
>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-jar-plugin</artifactId>
>                <configuration>
>                    <archive>
>                        <manifestEntries>
>                            <Built-By>xyz, Inc.</Built-By>
>                            <Build-date>?????</Build-date>
>                        </manifestEntries>
>                    </archive>
>                </configuration>
>            </plugin>
>
>  Thanks,
>
>  Sameh
> This email and any files transmitted with it are confidential, proprietary
> and intended solely for the individual or entity to whom they are addressed.
> If you have received this email in error please delete it immediately.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


RE: What is the syntax to retrieve a system property value form a pom?

Posted by "Tawfik, Sameh E" <Sa...@fairisaac.com>.
Thanks Wendy, this approach worked, but I'd to use the buildNumber
property and not the timestamp as I thought I would?

I must be using the wrong format, but I tried few choices and nothing
worked. The time stamp always appears as follow:

[INFO] Storing buildNumber: Apr 16, 2008 at timestamp: 1208394330099


Anyway, here is the code I'm using which is accomplishing what I need:


           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>buildnumber-maven-plugin</artifactId>
             <executions>
               <execution>
                 <phase>validate</phase>        
                 <goals>
                   <goal>create</goal>
                 </goals>
               </execution>
             </executions>
             <configuration>
               <doCheck>false</doCheck>
               <doUpdate>false</doUpdate>

               <format>{0,date}</format>
               <items>
                 <item>timestamp</item>
               </items>

             </configuration>
           </plugin>



            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Built-By>xyz, Inc.</Built-By>
                            <Build-date>${buildNumber}</Build-date>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>


-----Original Message-----
From: Wendy Smoak [mailto:wsmoak@gmail.com] 
Sent: Wednesday, April 16, 2008 3:29 PM
To: Maven Users List
Subject: Re: What is the syntax to retrieve a system property value form
a pom?

On Wed, Apr 16, 2008 at 2:49 PM, Tawfik, Sameh E
<Sa...@fairisaac.com> wrote:

>  I need to update the following parameter with the Build-date value. I
>  tried ${env.date} but it did not work?

You can use the Build Number plugin to put the current date into a
property that you can use in the build:

http://mojo.codehaus.org/buildnumber-maven-plugin/usage.html

-- 
Wendy

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

This email and any files transmitted with it are confidential, proprietary
and intended solely for the individual or entity to whom they are addressed.
If you have received this email in error please delete it immediately.


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


Re: What is the syntax to retrieve a system property value form a pom?

Posted by Wendy Smoak <ws...@gmail.com>.
On Wed, Apr 16, 2008 at 2:49 PM, Tawfik, Sameh E
<Sa...@fairisaac.com> wrote:

>  I need to update the following parameter with the Build-date value. I
>  tried ${env.date} but it did not work?

You can use the Build Number plugin to put the current date into a
property that you can use in the build:

http://mojo.codehaus.org/buildnumber-maven-plugin/usage.html

-- 
Wendy

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


What is the syntax to retrieve a system property value form a pom?

Posted by "Tawfik, Sameh E" <Sa...@fairisaac.com>.
Hi,

What is the syntax to use from inside a pom.xml file to retrieve the
value of the system date on Windows XP?

I need to update the following parameter with the Build-date value. I
tried ${env.date} but it did not work?

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Built-By>xyz, Inc.</Built-By>
                            <Build-date>?????</Build-date>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

 Thanks,

  Sameh
This email and any files transmitted with it are confidential, proprietary
and intended solely for the individual or entity to whom they are addressed.
If you have received this email in error please delete it immediately.


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


RE: Order of executing plugins changed in 2.0.9 ?

Posted by "Lacoste, Dana (TSG Software San Diego)" <da...@hp.com>.
But when you define an execution, you define what stage of the lifecycle it would be edited.

For example, I might use antrun to get something in generate-resources, and then compile, and
then use another antrun to package.

there's no issue doing this in one declaration of the plugin.

Contrarily, there IS an issue with declaring plugins multiply: the dependencies required for
the plugin (if any) might differ in the two declarations and get mixed up (maven only instantiates
a plugin once per run: it will "lose" the dependency information from the second call if the
first one has a different dependency list.)

I know this first hand: I was using jakarta-regexp (ant task) with antrun to do something in
an antrun declared in a profile, and using antrun separately in the pom.  the dual declarations
caused a huge headache trying to figure out why it didn't work!

The moral of the story is:

The maven way is "One plugin declaration, multiple executions"

Dana Lacoste

-----Original Message-----
From: Thierry Lach [mailto:thierry.lach@gmail.com]
Sent: Wednesday, April 16, 2008 2:11 PM
To: Maven Users List
Subject: Re: Order of executing plugins changed in 2.0.9 ?

One reason might be to run something else between the two?

On Wed, Apr 16, 2008 at 4:43 PM, Brian E. Fox <br...@reply.infinity.nu>
wrote:

> Why would you declare the plugin twice in the same pom? Just put
> multiple executions in the same definition.

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


Re: Order of executing plugins changed in 2.0.9 ?

Posted by Thierry Lach <th...@gmail.com>.
One reason might be to run something else between the two?

On Wed, Apr 16, 2008 at 4:43 PM, Brian E. Fox <br...@reply.infinity.nu>
wrote:

> Why would you declare the plugin twice in the same pom? Just put
> multiple executions in the same definition.
>
> -----Original Message-----
> From: Bernhard David [mailto:david.bernhard@elca.ch]
> Sent: Wednesday, April 16, 2008 10:22 AM
> To: Maven Users List
> Subject: RE: Order of executing plugins changed in 2.0.9 ?
>
> Hello,
>
> after some long hours with the debugger, I discovered the following.
>
> If I define a plugin twice like this:
>
> <plugin>
>        <groupId>org.codehaus.cargo</groupId>
>        <artifactId>cargo-maven2-plugin</artifactId>
>        <executions>
>                <execution>
>                        <id>start-container</id>
>                        <phase>pre-integration-test</phase>
>                        <goals>
>                                <goal>start</goal>
>                        </goals>
>                </execution>
>        </executions>
> </plugin>
> <plugin>
>        <groupId>org.codehaus.cargo</groupId>
>        <artifactId>cargo-maven2-plugin</artifactId>
>        <executions>
>                <execution>
>                        <id>deploy</id>
>                        <phase>pre-integration-test</phase>
>                        <goals>
>                                <goal>deploy</goal>
>                        </goals>
>                </execution>
>        </executions>
> </plugin>
>
> Maven executes the plugins backwards. (Deploy first)
>
> However, this can be fixed with
>
> <plugin>
>        <groupId>org.codehaus.cargo</groupId>
>        <artifactId>cargo-maven2-plugin</artifactId>
>        <executions>
>                <execution>
>                        <id>start-container-and-deploy</id>
>                        <phase>pre-integration-test</phase>
>                        <goals>
>                                <goal>start</goal>
>                                <goal>deploy</goal>
>                        </goals>
>                </execution>
>        </executions>
> </plugin>
>
> which solves my problem.
>
> The backwards issue does seem odd to me - I've posted to the dev list
> too, asking about it. The point is that the merging is done with the new
> definition as "parent" and the old one as "child", resulting in the
> parent coming first.
>
> Apart from this, you're right about the ordering.
>
> Yours,
>
> David Bernhard
>
> > -----Original Message-----
> > From: Max Bowsher [mailto:maxb1@ukf.net]
> > Sent: 16 April 2008 16:10
> > To: Maven Users List
> > Subject: Re: Order of executing plugins changed in 2.0.9 ?
> >
> > > Bernhard David wrote:
> > >> in maven 2.0.8 I can put the following in a pom to execute first
> > >> cargo:start then cargo:deploy in the pre-integration-test phase. In
> > >> 2.0.9, maven executes deploy first, which breaks the build.
> >
> > VUB Stefan Seidel wrote:
> >  > AFAIK, the execution of plugins in the same phase is not
> > consistent.
> >
> > I was under the impression that there was ordering of lifecycle bound
> > executions first, then executions from each pom in a parent-child
> > hierarchy in that order, and within each pom, in declaration order.
> >
> > Am I just imagining things?
> >
> > Max.
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Order of executing plugins changed in 2.0.9 ?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Why would you declare the plugin twice in the same pom? Just put
multiple executions in the same definition.

-----Original Message-----
From: Bernhard David [mailto:david.bernhard@elca.ch] 
Sent: Wednesday, April 16, 2008 10:22 AM
To: Maven Users List
Subject: RE: Order of executing plugins changed in 2.0.9 ?

Hello,

after some long hours with the debugger, I discovered the following.

If I define a plugin twice like this:

<plugin>
	<groupId>org.codehaus.cargo</groupId>
	<artifactId>cargo-maven2-plugin</artifactId>
	<executions>
		<execution>
			<id>start-container</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>start</goal>
			</goals>
		</execution>
	</executions>
</plugin>
<plugin>
	<groupId>org.codehaus.cargo</groupId>
	<artifactId>cargo-maven2-plugin</artifactId>
	<executions>
		<execution>
			<id>deploy</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>deploy</goal>
			</goals>
		</execution>
	</executions>
</plugin> 

Maven executes the plugins backwards. (Deploy first)

However, this can be fixed with 

<plugin>
	<groupId>org.codehaus.cargo</groupId>
	<artifactId>cargo-maven2-plugin</artifactId>
	<executions>
		<execution>
			<id>start-container-and-deploy</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>start</goal>
				<goal>deploy</goal>
			</goals>
		</execution>
	</executions>
</plugin>

which solves my problem.

The backwards issue does seem odd to me - I've posted to the dev list
too, asking about it. The point is that the merging is done with the new
definition as "parent" and the old one as "child", resulting in the
parent coming first.

Apart from this, you're right about the ordering. 

Yours,

David Bernhard

> -----Original Message-----
> From: Max Bowsher [mailto:maxb1@ukf.net] 
> Sent: 16 April 2008 16:10
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> > Bernhard David wrote:
> >> in maven 2.0.8 I can put the following in a pom to execute first
> >> cargo:start then cargo:deploy in the pre-integration-test phase. In
> >> 2.0.9, maven executes deploy first, which breaks the build.
> 
> VUB Stefan Seidel wrote:
>  > AFAIK, the execution of plugins in the same phase is not 
> consistent.
> 
> I was under the impression that there was ordering of lifecycle bound 
> executions first, then executions from each pom in a parent-child 
> hierarchy in that order, and within each pom, in declaration order.
> 
> Am I just imagining things?
> 
> Max.
> 
> 
> 

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


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


RE: Order of executing plugins changed in 2.0.9 ?

Posted by Bernhard David <da...@elca.ch>.
Hello,

the problem occurs when merging the two definitions of the same plugin into one. John Casey from the maven team just commented on the JIRA issue I submitted on this that two definitions of the same plugin in one pom should be a validation error. 

As far as two different plugins go, I haven't tested it but I imagine, as they are not merged, that the execution order is the order they are defined in the pom.

I'd be thankful if anyone could confirm or refute that statement though.

David

> -----Original Message-----
> From: VUB Stefan Seidel [mailto:sseidel@vub.de] 
> Sent: 16 April 2008 17:08
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> Wendy Smoak wrote:
> > On Wed, Apr 16, 2008 at 7:22 AM, Bernhard David 
> <da...@elca.ch> wrote:
> >> Hello,
> >>
> >>  after some long hours with the debugger, I discovered the 
> following.
> >>
> >>  If I define a plugin twice like this:
> > 
> > What happens if you put both <execution>s in the same <plugin>?
> > 
> > I see you've already solved it by consolidating even further, to one
> > execution with two goals.
> > 
> > I'm trying to think of a situation where you'd need to declare a
> > plugin twice in one phase-- usually multiple executions are fine.
> > 
> 
> The problem is: if it doesn't work with the same plugin 
> twice, it will 
> most probably not work with two different plugins - that's 
> what I had here.
> 
> Stefan
> -- 
> best regards,
> 
> Stefan Seidel
> software developer
> ________________________
> VUB Printmedia GmbH
> Chopinstraße 4
> D-04103 Leipzig
> Germany
> tel.    +49 (341) 9 60 50 07
> fax.    +49 (341) 9 60 50 92
> mail.   sseidel@vub.de
> web.    www.vub.de
> 
> HRB Köln 24015
> UStID DE 122 649 251
> GF Dr. Achim Preuss Neudorf,
> Dr. Christian Preuss Neudorf
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: Order of executing plugins changed in 2.0.9 ?

Posted by VUB Stefan Seidel <ss...@vub.de>.
Wendy Smoak wrote:
> On Wed, Apr 16, 2008 at 7:22 AM, Bernhard David <da...@elca.ch> wrote:
>> Hello,
>>
>>  after some long hours with the debugger, I discovered the following.
>>
>>  If I define a plugin twice like this:
> 
> What happens if you put both <execution>s in the same <plugin>?
> 
> I see you've already solved it by consolidating even further, to one
> execution with two goals.
> 
> I'm trying to think of a situation where you'd need to declare a
> plugin twice in one phase-- usually multiple executions are fine.
> 

The problem is: if it doesn't work with the same plugin twice, it will 
most probably not work with two different plugins - that's what I had here.

Stefan
-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

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


RE: Order of executing plugins changed in 2.0.9 ?

Posted by Bernhard David <da...@elca.ch>.
Hello,

due to the way merging is done (a plugin can have many executions, but
there cannot be two plugin definitions with the same name and phase) if
you add two <execution>s no merging is done and all is fine.

This issue arose because in EL4J we used to have two definitions in our
pom file which worked fine up until 2.0.8 - I've changed that now. I
suppose you might need two if they are both in different profiles or
different pom files.


David

> -----Original Message-----
> From: Wendy Smoak [mailto:wsmoak@gmail.com] 
> Sent: 16 April 2008 16:29
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> On Wed, Apr 16, 2008 at 7:22 AM, Bernhard David 
> <da...@elca.ch> wrote:
> > Hello,
> >
> >  after some long hours with the debugger, I discovered the 
> following.
> >
> >  If I define a plugin twice like this:
> 
> What happens if you put both <execution>s in the same <plugin>?
> 
> I see you've already solved it by consolidating even further, to one
> execution with two goals.
> 
> I'm trying to think of a situation where you'd need to declare a
> plugin twice in one phase-- usually multiple executions are fine.
> 
> -- 
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: Order of executing plugins changed in 2.0.9 ?

Posted by Wendy Smoak <ws...@gmail.com>.
On Wed, Apr 16, 2008 at 7:22 AM, Bernhard David <da...@elca.ch> wrote:
> Hello,
>
>  after some long hours with the debugger, I discovered the following.
>
>  If I define a plugin twice like this:

What happens if you put both <execution>s in the same <plugin>?

I see you've already solved it by consolidating even further, to one
execution with two goals.

I'm trying to think of a situation where you'd need to declare a
plugin twice in one phase-- usually multiple executions are fine.

-- 
Wendy

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


RE: Order of executing plugins changed in 2.0.9 ?

Posted by Bernhard David <da...@elca.ch>.
Thanks - it should be reconstructable from my last mail too, but I'll
make a test case anyway to simplify things.

David 

> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com] 
> Sent: 16 April 2008 16:23
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> > In practice and to my knowledge and experiences, it has 
> never been like
> > that.
> 
> If you can make a simple test case that demonstrates this bug and
> upload to JIRA, I'm sure someone will take a look at it.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: Order of executing plugins changed in 2.0.9 ?

Posted by Wayne Fay <wa...@gmail.com>.
> In practice and to my knowledge and experiences, it has never been like
> that.

If you can make a simple test case that demonstrates this bug and
upload to JIRA, I'm sure someone will take a look at it.

Wayne

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


Re: Order of executing plugins changed in 2.0.9 ?

Posted by VUB Stefan Seidel <ss...@vub.de>.
Max Bowsher wrote:
>> Bernhard David wrote:
>>> in maven 2.0.8 I can put the following in a pom to execute first
>>> cargo:start then cargo:deploy in the pre-integration-test phase. In
>>> 2.0.9, maven executes deploy first, which breaks the build.
> 
> VUB Stefan Seidel wrote:
>  > AFAIK, the execution of plugins in the same phase is not consistent.
> 
> I was under the impression that there was ordering of lifecycle bound 
> executions first, then executions from each pom in a parent-child 
> hierarchy in that order, and within each pom, in declaration order.
> 
> Am I just imagining things?

Actually, according to 
http://docs.codehaus.org/display/MAVENUSER/introduction-to-the-lifecycle 
you are right:
When multiple executions are given that match a particular phase, they 
are executed in the order specified in the POM,
with inherited executions running first.

In practice and to my knowledge and experiences, it has never been like 
that.

regards,

Stefan
-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

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


RE: Order of executing plugins changed in 2.0.9 ?

Posted by Bernhard David <da...@elca.ch>.
Hello,

after some long hours with the debugger, I discovered the following.

If I define a plugin twice like this:

<plugin>
	<groupId>org.codehaus.cargo</groupId>
	<artifactId>cargo-maven2-plugin</artifactId>
	<executions>
		<execution>
			<id>start-container</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>start</goal>
			</goals>
		</execution>
	</executions>
</plugin>
<plugin>
	<groupId>org.codehaus.cargo</groupId>
	<artifactId>cargo-maven2-plugin</artifactId>
	<executions>
		<execution>
			<id>deploy</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>deploy</goal>
			</goals>
		</execution>
	</executions>
</plugin> 

Maven executes the plugins backwards. (Deploy first)

However, this can be fixed with 

<plugin>
	<groupId>org.codehaus.cargo</groupId>
	<artifactId>cargo-maven2-plugin</artifactId>
	<executions>
		<execution>
			<id>start-container-and-deploy</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>start</goal>
				<goal>deploy</goal>
			</goals>
		</execution>
	</executions>
</plugin>

which solves my problem.

The backwards issue does seem odd to me - I've posted to the dev list
too, asking about it. The point is that the merging is done with the new
definition as "parent" and the old one as "child", resulting in the
parent coming first.

Apart from this, you're right about the ordering. 

Yours,

David Bernhard

> -----Original Message-----
> From: Max Bowsher [mailto:maxb1@ukf.net] 
> Sent: 16 April 2008 16:10
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> > Bernhard David wrote:
> >> in maven 2.0.8 I can put the following in a pom to execute first
> >> cargo:start then cargo:deploy in the pre-integration-test phase. In
> >> 2.0.9, maven executes deploy first, which breaks the build.
> 
> VUB Stefan Seidel wrote:
>  > AFAIK, the execution of plugins in the same phase is not 
> consistent.
> 
> I was under the impression that there was ordering of lifecycle bound 
> executions first, then executions from each pom in a parent-child 
> hierarchy in that order, and within each pom, in declaration order.
> 
> Am I just imagining things?
> 
> Max.
> 
> 
> 

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


Re: Order of executing plugins changed in 2.0.9 ?

Posted by Max Bowsher <ma...@ukf.net>.
> Bernhard David wrote:
>> in maven 2.0.8 I can put the following in a pom to execute first
>> cargo:start then cargo:deploy in the pre-integration-test phase. In
>> 2.0.9, maven executes deploy first, which breaks the build.

VUB Stefan Seidel wrote:
 > AFAIK, the execution of plugins in the same phase is not consistent.

I was under the impression that there was ordering of lifecycle bound 
executions first, then executions from each pom in a parent-child 
hierarchy in that order, and within each pom, in declaration order.

Am I just imagining things?

Max.



Re: Order of executing plugins changed in 2.0.9 ?

Posted by Jason van Zyl <ja...@maven.org>.
They are consistent for a given lifecycle, and a lifecycle is setup  
for a given packaging. The phases are consistent, what is bound to  
each phase differs.

On 16-Apr-08, at 12:08 AM, VUB Stefan Seidel wrote:
> Hi,
>
> AFAIK, the execution of plugins in the same phase is not consistent.  
> We have used 6 different phases to ensure the ordering is correct.  
> See http://cvs.peopleware.be/training/maven/maven2/buildLifecyclePhases.html
> for a good list.
>
> Stefan
>
> Bernhard David wrote:
>> Hello,
>> in maven 2.0.8 I can put the following in a pom to execute first
>> cargo:start then cargo:deploy in the pre-integration-test phase. In
>> 2.0.9, maven executes deploy first, which breaks the build. Declaring
>> the plugin once and having two <goal> entries in the <goals> doesn't
>> help.
>> <plugin>
>> <groupId>org.codehaus.cargo</groupId>
>> <artifactId>cargo-maven2-plugin</artifactId>
>> <executions>
>> 	<execution>
>> 		<id>start-container</id>
>> 		<phase>pre-integration-test</phase>
>> 		<goals>
>> 			<goal>start</goal>
>> 		</goals>
>> 	</execution>
>> </executions>
>> </plugin>
>> <plugin>
>> <groupId>org.codehaus.cargo</groupId>
>> <artifactId>cargo-maven2-plugin</artifactId>
>> <executions>
>> 	<execution>
>> 		<id>deploy</id>
>> 		<phase>pre-integration-test</phase>
>> 		<goals>
>> 			<goal>deploy</goal>
>> 		</goals>
>> 	</execution>
>> </executions>
>> </plugin>
>> **********
>> Shouldn't an entry like
>> <goals>
>> 	<goal>start</goal>
>> 	<goal>deploy</goal>
>> </goals>
>> force maven to do start first, then deploy? Is there a way to  
>> influence
>> this - or, what are the rules for execution order of plugins in a  
>> phase?
>> David
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>
> -- 
> best regards,
>
> Stefan Seidel
> software developer
> ________________________
> VUB Printmedia GmbH
> Chopinstraße 4
> D-04103 Leipzig
> Germany
> tel.    +49 (341) 9 60 50 07
> fax.    +49 (341) 9 60 50 92
> mail.   sseidel@vub.de
> web.    www.vub.de
>
> HRB Köln 24015
> UStID DE 122 649 251
> GF Dr. Achim Preuss Neudorf,
> Dr. Christian Preuss Neudorf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

We all have problems. How we deal with them is a measure of our worth.

-- Unknown 




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


Re: Order of executing plugins changed in 2.0.9 ?

Posted by VUB Stefan Seidel <ss...@vub.de>.
Hi,

AFAIK, the execution of plugins in the same phase is not consistent. We 
have used 6 different phases to ensure the ordering is correct. See 
http://cvs.peopleware.be/training/maven/maven2/buildLifecyclePhases.html
for a good list.

Stefan

Bernhard David wrote:
> Hello,
> 
> in maven 2.0.8 I can put the following in a pom to execute first
> cargo:start then cargo:deploy in the pre-integration-test phase. In
> 2.0.9, maven executes deploy first, which breaks the build. Declaring
> the plugin once and having two <goal> entries in the <goals> doesn't
> help.
> 
> <plugin>
> <groupId>org.codehaus.cargo</groupId>
> <artifactId>cargo-maven2-plugin</artifactId>
> <executions>
> 	<execution>
> 		<id>start-container</id>
> 		<phase>pre-integration-test</phase>
> 		<goals>
> 			<goal>start</goal>
> 		</goals>
> 	</execution>
> </executions>
> </plugin>
> 
> <plugin>
> <groupId>org.codehaus.cargo</groupId>
> <artifactId>cargo-maven2-plugin</artifactId>
> <executions>
> 	<execution>
> 		<id>deploy</id>
> 		<phase>pre-integration-test</phase>
> 		<goals>
> 			<goal>deploy</goal>
> 		</goals>
> 	</execution>
> </executions>
> </plugin>
> 
> **********
> 
> Shouldn't an entry like
> 
> <goals>
> 	<goal>start</goal>
> 	<goal>deploy</goal>
> </goals>
> 
> force maven to do start first, then deploy? Is there a way to influence
> this - or, what are the rules for execution order of plugins in a phase?
> 
> David
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

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