En l'instant précis du 18/03/08 12:43, Dominik Heller s'exprimait en ces termes:
Hi i am pretty new to maven and encountered a problem by overwriting some 
external resources. I am using maven 2.0.7 and the maven-war-plugin 2.0.2. What 
I want to do is to overwrite a folder config in the WEB-INF containing some 
files with an other folder config which is stored in an external resource 
folder until I build the project.
In the end it looks pretty much like this:

-src/main/
   -Customer/config
     -web.xml
     -config.xml
     -...
   -webapp/WEB-INF
     -config/...
     -web.xml

when building the project i want to use profiles to replace the web.xml and the 
config foilder in the WEB-INF. For replacing the web.xml I am using the 
<webXml> property but so far I didn't find a way to overwrite the config folder 
in the WEB-INF.
Any ideas someone??

thx in advance
Hi, we had similar requirement here. Here is our solution:

in build plugins:


     <plugin>
       <artifactId>maven-war-plugin</artifactId>
       <configuration>
         <warSourceDirectory>webapp</warSourceDirectory>
         <webResources>
           <resource>
             <!-- this is relative to the pom.xml directory -->
             <directory>configSets/${config.configSet}</directory>
           </resource>
         </webResources>
       </configuration>
     </plugin>

in profiles:

   <profile>
       <id>user-x</id>
       <activation>
         <property>
           <name>user</name>
           <value>x</value>
         </property>
</activation> <properties>
       <config.configSet>userX</config.configSet>
     </properties>
   </profile>

We make our package using

mvn package -Duser=x

and it will override, in war, existing files with those found in configSets/userX/


--
David Delbecq
Institut Royal Météorologique
Ext:557


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

Reply via email to