Issue Details (XML | Word | Printable)

Key: MNG-1499
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: John Casey
Reporter: David Jackman
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven 2

Execution order is arbitrary if inheritance is involved

Created: 10/Nov/05 11:33 AM   Updated: 30/Apr/06 02:00 PM
Component/s: Inheritance and Interpolation
Affects Version/s: None
Fix Version/s: 2.0.1

Time Tracking:
Not Specified

File Attachments: 1. Text File MNG-1499-b.patch (7 kB)
2. Text File MNG-1499.patch (1 kB)

Issue Links:
Related
 
dependent
 

Complexity: Intermediate


 Description  « Hide
According to the documentation, "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." I assume that the order of the inherited executions would be in the order specified in the parent POM, but the docs are unclear here.

However, in practice, it seems the ordering is as documented if there is no inheritance from the parent. But if there are plugins inherited, then the ordering is completely arbitrary, with the inherited plugins not necessarily coming first. I created a project that runs two plugins, both bound to the same phase, with one specified in the parent and one specified in the project. The parent-specified plugin does not run first.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
David Jackman added a comment - 10/Nov/05 12:40 PM
The attached patch fixes this problem. Instead of keeping the list of merged plugins for parent and child in a map, it keeps the list in a List. (It still uses the maps to make sure plugins are only executed once if mentioned in both parent and child.)

David Jackman added a comment - 10/Nov/05 01:32 PM
After further inspection, I realized that the ModelUtils.mergePluginDefinitions method had the same problem. The second attached patch fixes the problem there as well. This patch also adds unit tests to cover these changes.

John Casey added a comment - 17/Nov/05 02:48 PM
Applied. Thanks, David.