You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Vraalsen Fredrik <Fr...@sintef.no> on 2006/05/02 09:49:28 UTC

Plugin execution order within lifecycle phase

Hi,

I am in the process of moving a project from m1 to m2, and I have
encountered a problem with the ordering of plugin executions within a
single lifecycle phase.  I use two plugins that contribute during the
generate-sources phase; a homegrown plugin for generating sources from
UML, and xdoclet.  The sources generated from UML are supposed to be
passed to xdoclet in order to generate various EJB value objects etc.  

In m1 I could just order the plugins using preGoal in maven.xml, but in
m2 I haven't been able to find a solution.  According to the
"Introduction to the build lifecycle" document at
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycl
e.html, "If more than one goal is bound to a particular phase, the order
used is that those from the packaging are executed first, followed by
those configured in the POM. Note that you can use the executions
element to gain more control over the order of particular goals."
However, this does not seem to work, and it is also not clear how I can
gain more control over the order using the executions element, unless
this only refers to multiple executions of the same plugin within a
lifecycle phase?

I have searched through the maven website, faq and mailing lists without
any luck.  However, it seems that others have encountered the same
issue, e.g.
http://www.nabble.com/%7Bm2-plugin-execution-order-t749791.html and
http://www.nabble.com/Execution-order-of-plugins-t1519638.html.

Is there any way to achieve what I'm looking for in m2?

Below is an excerpt from my pom.xml (plugin configuration omitted for
brevity).  This pom also inherits from a parent pom which includes a
plugins section to configure the maven-compiler-plugin java source and
target versions.

	<build>
		<plugins>
			<plugin>
				<groupId>sintef</groupId>
	
<artifactId>maven-umt-plugin</artifactId>
				<executions>
					<execution>
	
<phase>generate-sources</phase>
						<goals>
	
<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
	
<artifactId>xdoclet-maven-plugin</artifactId>
				<executions>
					<execution>
	
<phase>generate-sources</phase>
						<goals>
	
<goal>xdoclet</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>


Thanks in advance,

-- 
Fredrik Vraalsen
Research Scientist
SINTEF Information and Communication Technology
 
Phone: (+47) 22 06 73 45 (direct) / (+47) 98 46 22 55 (mobile)
Fax: (+47) 22 06 73 50
E-mail: fredrik.vraalsen@sintef.no
Web: http://www.sintef.no/


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