You're right, you can't do it by default.
But to do it, it's "very" simple.

In each subproject you create a maven.xml file with :

- in myproj-util :
<project default="myproj:default">
  <goal name="myproj:default" prereqs="jar:install"/>
</project>

- in myproj-ejb :
<project default="myproj:default">
  <goal name="myproj:default" prereqs="ejb:install"/>
</project>

- in myproj-web :
<project default="myproj:default">
  <goal name="myproj:default" prereqs="war:install"/>
</project>

- in myproj-app :
<project default="myproj:default">
  <goal name="myproj:default" prereqs="ear:install"/>
</project>


And in your project's root :
A maven.xml file :
<project default="myproj:default">
  <goal name="myproj:default">
    <j:set var="goal" value="myproj:default"/>
    <attainGoal name="multiproject:goal"/>
  </goal>
</project>

A project.properties file :

# Multiproject properties
maven.multiproject.includes=**/project.xml
maven.multiproject.excludes=project.xml


You type in your root directory : maven :-)

Arnaud
 

> -----Message d'origine-----
> De : James Adams [mailto:[EMAIL PROTECTED] 
> Envoy� : mercredi 16 f�vrier 2005 22:27
> � : Maven Users List
> Objet : Re: How to build a EAR with EJB and WAR included ?
> 
> Thanks for the help so far.  After some initial confusion 
> I've come up with a working solution.  I have broken my 
> project up into three separate projects (myproj-util, 
> myproj-ejb, and myproj-web) and created an overall project 
> for creating the EAR (myproj-app). 
> I found
> http://www-106.ibm.com/developerworks/java/library/j-maven/index.html
> to be a very helpful resource, with a good explanation of how 
> I can extend the main POM in order to have the same version 
> number across all of the modules.
> 
> I'd like to come up with a way to run one maven command to do 
> the following:
> 
> 1. create and install the myproj-util-<version>.jar 2. create 
> and install the myproj-ejb-<version>.jar 3. create and 
> install the myproj-web-<version>.war 4. create and install 
> the myproj-app-<version>.ear
> 
> From what I can tell this is not possible with a single maven 
> command and I will have to cook up a script which will call 
> the jar:install, ejb:install, war:install, and ear:install 
> maven goals from the proper directories.  Is this really the 
> case, or am I missing something ?
> 
> 
> --James
> 
> 
>               
> __________________________________
> Do you Yahoo!? 
> Take Yahoo! Mail with you! Get it on your mobile phone. 
> http://mobile.yahoo.com/maildemo 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 




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

Reply via email to