Nidhi Tuli wrote:

I want to define a sequence of execution of maven commands using maven2.
I don't want to follow the regular life cycle. I am building ejb3
project and would like the execution should be in
compile,jar,ejb3,par,ear sequence. And when I do
Mvn ear:ear -- It should first compile then jar it, then ejb3 and par
and last does ear.


I have already specified the packaging to be <packaging>ear</packaging>

but when I do ear, it does not follow the right order.


Please help.
/Nidhi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Hello Nidhi,

The easiest way that I can think of to achieve this is to restructure your project into a multiproject build. Separate your project into modules like so:

parent
  |
 +- jar
 +- ejb3
 +- par
 +- ear

This way, you can specify the build order in the parent pom in the <modules> section. Each module (child) would of course have their own poms also. You also have to specify the parent in the <parent> section of each child module's pom. For example, the parent pom would have this:

<modules>
  <module>jar-module-artifactId</module>
  <module>ejb3-module-artifactId</module>
  <module>par-module-artifactId</module>
  <module>ear-module-artifactId</module>
</modules>

The order in which you specify the modules determines the build order. Each child's pom should also have this:

<parent>
  <groupId>parent-groupId</groupId>
  <artifactId>parent-artifactId</artifactId>
  <version>parent-version</version>
</parent>

Hope this helps.

Henry

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to