You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Brian E. Fox" <br...@reply.infinity.nu> on 2005/12/02 23:04:49 UTC

RE: RE : War phases, binding a custom plugin to the war creation

I actually have this same issue and created a separate plugin to do this. It grabs a specified dependancy from the repository and explodes it where I tell it to. As long as this happens before the war plugin is called, everything seems ok. It doesn't merge the web.xml but we decided that would be ok and we just use the one from the dependant project. Since the pom will need to know all the dependancies, the web.xml can be preconfigured as well. The plugin can also copy artifacts without exploding them. I'm exploring what to do with this code, if I should release it somewhere or add it to another plugin etc. Suggestions welcome. 
 

-----Original Message-----
From: Richard Allen [mailto:richard.allen@gtri.gatech.edu] 
Sent: Tuesday, November 29, 2005 7:42 PM
To: Maven Users List
Subject: Re: RE : War phases, binding a custom plugin to the war creation

I'm definitely interested in this. We use Struts modules and we keep each Struts module in a separate project. We have to merge the various Struts modules during the build process (which are each like a WAR). I'm currently using a maven-war-plugin hack that a previous user posted to the list (may have been you Kevin), but I would like to see something more standard in place, especially since this seems to be a common use case.

Thanks,
Richard Allen


Kevin Galligan wrote:

> I've hacked up the maven-war-plugin to merge war dependencies into the 
> final product.  I posted the code originally, but I've added a few 
> things since then.  These include an updated version of the cargo 
> web.xml merging code.  The current version only merges certain parts 
> of the web.xml.  Internally we needed more.
>
> I also track the war file version to we don't need a full extract of 
> dependent wars every time a build is done.  The way I do this is very 
> hacky, but functional.
>
> Anyway, wondering if anybody would be interested, and/or if this kind 
> of functionality would be considered for a future add.
>
> Olivier Lamy wrote:
>
>> Hi,
>> I'm happy to see that some users needs more feature in the 
>> maven-war-plugin !!
>> It works but for simple webapp and you need to add some embedeed ant 
>> scripts in order to copy some files (it's really clean).
>> I have provided a patch http://jira.codehaus.org/browse/MNG-1683 
>> which add some features.
>> Take this
>> http://jira.codehaus.org/secure/attachment/17799/maven-war-plugin.tar
>> .gz
>>
>> - Unzip it - install the plugin : mvn -DupdateReleaseInfo=true clean 
>> install
>> - look at the documentation : mvn site
>>
>> Exemple :
>> To add jsp files add this in the configuration :
>>         <webappDirectory
>> implementation="java.io.File">${basedir}/webappdir</webappDirectory>
>>           <resources>
>>             <resource>
>>               <directory>${basedir}/src/main/jsp</directory>
>>
>>               <targetPath>${basedir}/webappdir</targetPath>
>>           <!-- note ${webappDirectory} doesn't work due to some 
>> introspection trouble
>>             I have updated my local version to copy resources to a 
>> target path relative to ${webappDirectory}
>>          -->
>>             </resource>
>>                     </resources>
>>
>> I don't really know if this kind of features will be added one day in 
>> the maven-war-plugin.... (because in some contexts create a war is 
>> more complicated than the jobs provided by the default plugin)
>>
>> Note the issue http://jira.codehaus.org/browse/MNG-791 (mark as fixed 
>> in 2.0.1).
>>
>> HTH,
>>
>> - Olivier
>>
>> -----Message d'origine-----
>> De : Bruno Aranda [mailto:brunoaranda@gmail.com] Envoyé : mardi 29 
>> novembre 2005 18:46 À : Maven Users List Objet : War phases, binding 
>> a custom plugin to the war creation
>>
>>
>> Hi all,
>>
>> I would like to know what phase I have to use to bind a plugin to the 
>> war creation (war:war).
>>
>>  <plugin>
>>      <groupId>my.groupId</groupId>
>>      <artifactId>maven-myPlugin-plugin</artifactId>
>>      <executions>
>>        <execution>
>>          <phase>WHAT TO PUT HERE</phase>
>>          <goals>
>>            <goal>myPluginGoal</goal>
>>          </goals>
>>        </execution>
>>      </executions>
>>    </plugin>
>>
>> It works ok for the process-resources and package phases, but the 
>> first is too early, and the other is too late. I am trying to copy 
>> some JSP pages in a specific way to the exploded war folder before 
>> creating the war file,
>>
>> TIA,
>>
>> Bruno
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>> This e-mail, any attachments and the information contained therein 
>> ("this message") are confidential and intended solely for the use of 
>> the addressee(s). If you have received this message in error please 
>> send it back to the sender and delete it. Unauthorized publication, 
>> use, dissemination or disclosure of this message, either in whole or 
>> in part is strictly prohibited.
>> *********************************************************************
>> * Ce message électronique et tous les fichiers joints ainsi que  les 
>> informations contenues dans ce message ( ci après "le message" ), 
>> sont confidentiels et destinés exclusivement à l'usage de la personne 
>> à laquelle ils sont adressés. Si vous avez reçu ce message par 
>> erreur, merci  de le renvoyer à son émetteur et de le détruire.
>> Toutes diffusion, publication, totale ou partielle ou divulgation 
>> sous quelque forme que se soit non expressément autorisées de ce 
>> message, sont interdites.
>> *********************************************************************
>> *
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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



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