ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: Specifying build properties
Date Mon, 24 Oct 2005 12:29:13 GMT
Rakesh Patel wrote:
> Hi,
> Is there a way to specify which build file to use within a target?
> I use my local machine for building the war for the development
> environment and the production one. The properties are picked up from
> but I have to change this file each time depending on
> where I am going to deploy to.
> I would like separate tasks, one for each environment, and within the
> target specify which property file to use (eg,

Add a property into the mix to hold the name of the props

<target name="load-server-props">
  <fail unless="">No server</fail>
  <properties file="conf/${}.properties "/>

<target name="war" depends="load-server-props">
  <war ...>

At the same time, I want to warn you about the perils of having 
different WAR files for different destinations, as you can be sure that 
the wrong version will eventually get onto the wrong box. There are 
better approaches from the most advanced, SmartFrog : , to a simpler 
technique I've used in the past: having a properties file for each 
system in the WAR file, and having the webapp load these dynamically 
based on their hostname.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message