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

Order of plugin execution

Hello,

I'm trying to use the cargo plugin to start a container and then deploy
to it. In maven 2.0.9, this works :

<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>

As expected, start executes before deploy. However, if I use two plugin
definitions:

<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
	<execution>
		<id>start</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>

then Maven 2.0.9 runs the deploy first. The reason for this is that, in
ModelUtils.java:MergePluginDefinitions, the function is called with the
first deinition as child and the second as parent, then writing the
parent's executions before the child's into the merged ones.

Is this behaviour intentional? To me, executing that first which is
defined first in the pom makes more sense - right now, a sequences of
executions of the same plugins is processed last-one-first.

Greetings,

David

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