Search code examples
mavennetbeansweb-inf

Maven custom/multiple web.xml


I decided to customize the web.xml due to the fact application will be deployed in multiple urls (internal/external facing). I have a custom-resources folder and decided to put the custom web.xml in there.

However I can't manage to put it in the WEB-INF folder. I have created two resources one with inclusion and one with exclusion of web.xml. I have tried putting ${project.build.directory}/WEB-INF or WEB-INF or ..

I am on netbeans 8. It uses Maven 3. I am not sure if netbeans is tweaking things under the cover.

 <resource>
   <directory>custom-resources/dev</directory>
   <includes>
     <include>**/web.xml</include>
   </includes>
   <targetPath>..</targetPath>
 </resource>

Solution

  • I could not get this done since automatically all the custom resources are copied to WEB-INF/classes. Decided to use the copy-resources plugin. The process is explained here . If anyone has a different solution, please post it.