dcsimg
Building for different environments.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Chelimsky
Posted On:   Wednesday, October 31, 2001 11:27 PM

I've got a property in build.xml called build.destination that defaults to "development" for my PC. I want to be able to set this from the command line (-Dbuild.destination=production) and have that trigger the use of some different values of properties. Specifically, I'm using ant's copy task to copy web.xml from my src tree to a distribution tree before packaging the distribution tree in a .war file. I'm then replacing tokens in the copied web.xml with their correct values for my development environment, but I'd like to replace them w/ values that are correct for my production environment when adding -Dbuild.destination=production to the command line. Any ideas would be appreciated. Thank you, David    More>>

I've got a property in build.xml called build.destination that defaults to "development" for my PC. I want to be able to set this from the command line (-Dbuild.destination=production) and have that trigger the use of some different values of properties. Specifically, I'm using ant's copy task to copy web.xml from my src tree to a distribution tree before packaging the distribution tree in a .war file. I'm then replacing tokens in the copied web.xml with their correct values for my development environment, but I'd like to replace them w/ values that are correct for my production environment when adding -Dbuild.destination=production to the command line.

Any ideas would be appreciated.

Thank you,
David

   <<Less

Re: Building for different environments.

Posted By:   Erik_Hatcher  
Posted On:   Thursday, November 1, 2001 02:49 AM

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:


-or-


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).
About | Sitemap | Contact