We do something like this, where the artifacts and the war are all part of the
same multiproject.  Our war artifact project has a property:
maven.multiproject.type=war

Then when you run 'maven multiproject:install', which then calls war:install,
which calls war:webapp.

This way you don't have any maven.xml stuff to maintain; its all provided by
Maven.

T

-----Original Message-----
From: Arik Kfir [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 8:05 PM
To: Maven Users List
Subject: Re: Single WAR from multiproject


Yes, in the main project add a file called "maven.xml" - you can write 
your own goals there. Simple write this in the file:

<project xmlns:maven="jelly:maven" xmlns:ant="jelly:ant" 
xmlns:j="jelly:core" xmlns:u="jelly:util">
    <goal name="project:create-war" prereqs="multiproject:install,war"/>
</project>

this should do the trick. have a good one!

[EMAIL PROTECTED] wrote:

>Hi,
>
>Thanks!!  That works great.
>
>Only problem is that I now require two steps - the multiproject 
>jar:install from the top directory, and then the webapp war from the 
>webapp sub-directory.
>
>Is there any way to get maven to do both in a single command?
>
>cheers,
>
>David
>
>
>
>|---------+---------------------------->
>|         |           Arik Kfir        |
>|         |           <[EMAIL PROTECTED]|
>|         |           om>              |
>|         |                            |
>|         |           04/27/2005 05:10 |
>|         |           PM               |
>|         |           Please respond to|
>|         |           "Maven Users     |
>|         |           List"            |
>|         |                            |
>|---------+---------------------------->
>
>--------------------------------------------------------------------------------
-------------------------------|
>  |
|
>  |       To:       Maven Users List <[email protected]>
|
>  |       cc:
|
>  |       Subject:  Re: Single WAR from multiproject
|
>  
> >---------------------------------------------------------------------
> ------------------------------------------|
>
>
>
>
>oh, in addition, I would recommend running jar:install on each of the 
>other projects (you can do this more easily using the multiproject 
>plugin - http://maven.apache.org/using/multiproject.html) - running 
>jar:install will "install" the new generated jar of that project into 
>the repository, from which the war plugin will download and place in 
>your war file.
>
>Arik Kfir wrote:
>
>  
>
>>I assume you have one project containing the web application (prolly 
>>src/webapp), and the other three generate the class files, which 
>>result in JAR files that should be placed in the WEB-INF/lib, correct?
>>
>>If so, simply have the webapp project use the other three as 
>>dependencies, and in each dependency state that you want its output to 
>>be included in the war, like this:
>>
>><dependency>
>>   <groupId>the_other_proj_grp_id</groupId>
>>   <artifactId>the_other_proj_id</artifactId>
>>   <version>...</version>
>>   <properties>
>>      *<war.bundle>true</war.bundle>*
>>    
>>
>
>  
>


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

Reply via email to