Re: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread VUB Stefan Seidel

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
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
idstart-container/id
phasepre-integration-test/phase
goals
goalstart/goal
/goals
/execution
/executions
/plugin

plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
iddeploy/id
phasepre-integration-test/phase
goals
goaldeploy/goal
/goals
/execution
/executions
/plugin

**

Shouldn't an entry like

goals
goalstart/goal
goaldeploy/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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
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.   [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Jason van Zyl
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
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
idstart-container/id
phasepre-integration-test/phase
goals
goalstart/goal
/goals
/execution
/executions
/plugin
plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
iddeploy/id
phasepre-integration-test/phase
goals
goaldeploy/goal
/goals
/execution
/executions
/plugin
**
Shouldn't an entry like
goals
goalstart/goal
goaldeploy/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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
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.   [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Bernhard David
Hello,

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

If I define a plugin twice like this:

plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
idstart-container/id
phasepre-integration-test/phase
goals
goalstart/goal
/goals
/execution
/executions
/plugin
plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
iddeploy/id
phasepre-integration-test/phase
goals
goaldeploy/goal
/goals
/execution
/executions
/plugin 

Maven executes the plugins backwards. (Deploy first)

However, this can be fixed with 

plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
idstart-container-and-deploy/id
phasepre-integration-test/phase
goals
goalstart/goal
goaldeploy/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:[EMAIL PROTECTED] 
 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Wayne Fay
 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Bernhard David
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:[EMAIL PROTECTED] 
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread VUB Stefan Seidel


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.   [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Max Bowsher

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.




signature.asc
Description: OpenPGP digital signature


Re: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Wendy Smoak
On Wed, Apr 16, 2008 at 7:22 AM, Bernhard David [EMAIL PROTECTED] 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 executions 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Bernhard David
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 executions 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:[EMAIL PROTECTED] 
 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 
 [EMAIL PROTECTED] 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 executions 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Bernhard David
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:[EMAIL PROTECTED] 
 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 
 [EMAIL PROTECTED] 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 executions 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.   [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread VUB Stefan Seidel

Wendy Smoak wrote:

On Wed, Apr 16, 2008 at 7:22 AM, Bernhard David [EMAIL PROTECTED] 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 executions 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.   [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Brian E. Fox
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:[EMAIL PROTECTED] 
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
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
idstart-container/id
phasepre-integration-test/phase
goals
goalstart/goal
/goals
/execution
/executions
/plugin
plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
iddeploy/id
phasepre-integration-test/phase
goals
goaldeploy/goal
/goals
/execution
/executions
/plugin 

Maven executes the plugins backwards. (Deploy first)

However, this can be fixed with 

plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
idstart-container-and-deploy/id
phasepre-integration-test/phase
goals
goalstart/goal
goaldeploy/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:[EMAIL PROTECTED] 
 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Thierry Lach
One reason might be to run something else between the two?

On Wed, Apr 16, 2008 at 4:43 PM, Brian E. Fox [EMAIL PROTECTED]
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:[EMAIL PROTECTED]
 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
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
idstart-container/id
phasepre-integration-test/phase
goals
goalstart/goal
/goals
/execution
/executions
 /plugin
 plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
iddeploy/id
phasepre-integration-test/phase
goals
goaldeploy/goal
/goals
/execution
/executions
 /plugin

 Maven executes the plugins backwards. (Deploy first)

 However, this can be fixed with

 plugin
groupIdorg.codehaus.cargo/groupId
artifactIdcargo-maven2-plugin/artifactId
executions
execution
idstart-container-and-deploy/id
phasepre-integration-test/phase
goals
goalstart/goal
goaldeploy/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:[EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Lacoste, Dana (TSG Software San Diego)
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:[EMAIL PROTECTED]
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 [EMAIL PROTECTED]
wrote:

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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]