Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.0, 3.0.1, 3.0.2
-
Fix Version/s: 3.0.3
-
Component/s: Plugins and Lifecycle
-
Labels:None
-
Environment:I reproduced the problem with maven 3.0, 3.0.1 and 3.0.2. It doesn't exist in 2.2.1
MacOS 1.6 JVM
-
Complexity:Intermediate
-
Testcase included:yes
-
Number of attachments :
Description
Let's imagine we have a lifecycle phase where we want to bind several mojos.
We want to force the order of execution of our mojos in this phase thus we use ordered execution IDs (00exec, 01exec, ...).
In project's build part we define 00exec, 01exec, 02exec
In a profile #1 we define 03exec,04exec
In a profile #2 we define 05exec,06exec
If I execute my build without profiles I want to see the execution of 00->01->02
If I activate profile #1 I want to see the execution of 00->01->02->03->04
If I activate profile #2 I want to see the execution of 00->01->02->03->04->05->06
This the behavior we have in Maven 2.X. Any combinaison of profiles will ensure executions are ordered following IDs order
In Maven 3.x it is no more the case.
Without profile we have 00->01->02 (GREAT)
With Profile 1 activate we have : 03->04->00->01->02 (
)
With Profile 1 & 2 activate we have : 05->06->03->04->00->01->02 (
)
I attach a simple testcase with an antrun to show the problem.
Just play with mvn package and profiles profile1 & profile2
Note that the order depends also of the order of profiles declaration in the POM in M3
If profile1 is defined before profile 2 I have 05->06->03->04->00->01->02
If profile2 is defined before profile 1 I have 03->04->05->06->00->01->02
Issue Links
- is related to
-
MNG-3925
[regression] Wrong order of plugin executions after merge with executions inherted from parent
-
Activity
| Field | Original Value | New Value |
|---|---|---|
| Description |
Let's imagine we have a lifecycle phase where we want to bind several mojos.
We want to force the order of execution of our mojos in this phase thus we use ordered execution IDs (00exec, 01exec, ...). In project's build part we define 00exec, 01exec, 02exec In a profile #1 we define 03exec,04exec In a profile #2 we define 05exec,06exec If I execute my build without profiles I want to see the execution of 00->01->02 If I activate profile #1 I want to see the execution of 00->01->02->03->04 If I activate profile #2 I want to see the execution of 00->01->02->03->04->05->06 This the behavior we have in Maven 2.X. Any combinaison of profiles will ensure executions are ordered following IDs order In Maven 3.x it is no more the case. Without profile we have 00->01->02 (GREAT) With Profile 1 activate we have : 03->04->00->01->02 With Profile 1 & 2 activate we have : 05->06->03->04->00->01->02 I attach a simple testcase with an antrun to show the problem. Just play with {{mvn package}} and profiles {{profile1}} & {{profile2}} Note that the order depends also of the order of profiles declaration in the POM in M3 If profile1 is defined before profile 2 I have 05->06->03->04->00->01->02 If profile2 is defined before profile 1 I have 03->04->05->06->00->01->02 |
Let's imagine we have a lifecycle phase where we want to bind several mojos.
We want to force the order of execution of our mojos in this phase thus we use ordered execution IDs (00exec, 01exec, ...). In project's build part we define 00exec, 01exec, 02exec In a profile #1 we define 03exec,04exec In a profile #2 we define 05exec,06exec If I execute my build without profiles I want to see the execution of 00->01->02 If I activate profile #1 I want to see the execution of 00->01->02->03->04 If I activate profile #2 I want to see the execution of 00->01->02->03->04->05->06 This the behavior we have in Maven 2.X. Any combinaison of profiles will ensure executions are ordered following IDs order In Maven 3.x it is no more the case. Without profile we have 00->01->02 (GREAT) With Profile 1 activate we have : 03->04->00->01->02 ( :( ) With Profile 1 & 2 activate we have : 05->06->03->04->00->01->02 ( :( ) I attach a simple testcase with an antrun to show the problem. Just play with {{mvn package}} and profiles {{profile1}} & {{profile2}} Note that the order depends also of the order of profiles declaration in the POM in M3 If profile1 is defined before profile 2 I have 05->06->03->04->00->01->02 If profile2 is defined before profile 1 I have 03->04->05->06->00->01->02 |
| Summary | [REGRESSION] mojos execution order doesn't respect ids if profiles are used. | [regression] plugin executions injected from profile run before instead of after existing executions in the POM |
| Status | Open [ 1 ] | Closed [ 6 ] |
| Assignee | Benjamin Bentmann [ bentmann ] | |
| Fix Version/s | 3.0.3 [ 17061 ] | |
| Resolution | Fixed [ 1 ] |