How do I include different web.xml files in order to switch between production and development builds?

Erik Hatcher

Several ways to do this kind of thing, but the simplest is to put your two different web.xml files into different directories named 'production' and 'development' (or alternatively name your files web-production.xml and web-development.xml) - just as long as the words 'development' and 'production' are part of the filename.

Then you can do a copy:

<copy todir="build/WEB-INF" file="WEB-INF/${build.destination}/web.xml"/>
-or-
<copy todir="build/WEB-INF" file="WEB-INF/web-${build.destination}.xml"/>
Another way to handle this is to have a single tokenized web.xml (if only some values change between the two) and use a filtered copy (load ${build.production}.properties).
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact