[
https://jira.codehaus.org/browse/MNG-2258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=299149#comment-299149
]
Scott Glajch edited comment on MNG-2258 at 5/18/12 9:55 AM:
------------------------------------------------------------
I'm not sure if this warrants reopening this bug or a new bug (or hopefully I'm
missing something and just doing it wrong), but I think a slightly more
complicated version of this use case is failing for us.
We are using 3.0.3 and in general, the ordering of plugins with the same
lifecycle phase is consistent to the order they were declared in the pom.
However it appears that once we add another plugin execution for the same
plugin type and the same lifecycle in a parent pom, the ordering gets screwed
up.
Our pom has 3 plugins executing during the "prepare-package" lifecycle
currently. They are (in order of declaration in the pom):
maven-war-plugin:2.2.rsa3:exploded (default)
maven-rsa-generate-resource-bundles-plugin:1.21:process-product-conditional-files
(default)
gmaven-plugin:1.3:execute (perform xslt transformation)
They execute in the correct order. Then, in the parent pom for our projects we
added this to the "prepare-package" lifecycle:
gmaven-plugin:1.3:execute (add-p4-variable-to-rebel-xml)
Now when our project runs, the plugins get executed in this order:
maven-rsa-generate-resource-bundles-plugin:1.21:process-product-conditional-files
(default)
gmaven-plugin:1.3:execute (add-p4-variable-to-rebel-xml)
gmaven-plugin:1.3:execute (perform xslt transformation)
I don't know if the fourth goal (the war plugin goal) ever gets executed
because the build fails during "perform xslt transformation" because it is
relying on the war goal to run first.
I would hazard a guess that the problem has to do with either inserting plugin
executions from a parent project, or the combination of that and the fact that
the same plugin was defined in both the current and parent project. The
ordering logic might never have taken this into account because you're not
allowed to define the same plugin twice within the same pom file.
was (Author: glajchs):
I'm not sure if this warrants reopening this bug or a new bug (or hopefully
I'm missing something and just doing it wrong), but I think a slightly more
complicated version of this use case is failing for us.
We are using 3.0.3, and in general, the ordering of plugins with the same
lifecycle phase is consistent to the order they were declared in the pom.
However it appears that once we add another plugin execution for the same
plugin type and the same lifecycle in a parent pom, the ordering gets screwed
up.
Our pom has 3 plugins executing during the "prepare-package" lifecycle
currently. They are (in order of declaration in the pom):
maven-war-plugin:2.2.rsa3:exploded (default)
maven-rsa-generate-resource-bundles-plugin:1.21:process-product-conditional-files
(default)
gmaven-plugin:1.3:execute (perform xslt transformation)
Just like they, they execute in the correct order. Then, in the parent pom for
our projects we added this to the "prepare-package" lifecycle:
gmaven-plugin:1.3:execute (add-p4-variable-to-rebel-xml)
Now when our project runs, the plugins get executed in this order:
maven-rsa-generate-resource-bundles-plugin:1.21:process-product-conditional-files
(default)
gmaven-plugin:1.3:execute (add-p4-variable-to-rebel-xml)
gmaven-plugin:1.3:execute (perform xslt transformation)
I don't know if the fourth goal (the war plugin goal) ever gets executed
because the build fails during "perform xslt transformation" because it is
relying on the war goal to run first.
I would hazard a guess that the problem has to do with either inserting plugin
executions from a parent project, or the combination of that and the fact that
the same plugin was defined in both the current and parent project. The
ordering logic might never have taken this into account because you're not
allowed to define the same plugin twice within the same pom file.
> Wrong execution order of plugins in same phase
> ----------------------------------------------
>
> Key: MNG-2258
> URL: https://jira.codehaus.org/browse/MNG-2258
> Project: Maven 2 & 3
> Issue Type: Bug
> Affects Versions: 2.0.4
> Environment: N/A
> Reporter: David J. M. Karlsen
> Assignee: Benson Margulies
> Priority: Blocker
> Fix For: 3.0.3
>
> Attachments: mavenTest.zip
>
>
> AFAIK plugins should be execute in the same order as they are listed in the
> POM, when bound to the same phase. This does not happen, the execution order
> is arbitrary.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira