ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey E Care <>
Subject RE: Specifiying user properties file
Date Sun, 06 Nov 2005 03:40:45 GMT
You can also use the fact that Ant creates implicit properties from the 
Java  system properties and do something like this:

    <property file="${user.home}/"/>

This will load the user's specific properties file from their home 

Jeffrey E. Care (
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)

"Bill Rich" <> wrote on 11/05/2005 08:05:04 PM:

> Ahh, but is even better to take advantage of the fact that properties 
> immutable.
> For example, I have a file called that contains some 
> property settings. If the user does not want to use them then she just
> specifies a user name on the command line and the file 
> not loaded, instead a tailored user properties file is loaded. Because 
> property is immutable the value assigned to the property USER will 
> come from the command line or from the declaration in the build file.
> <property name="USER" value="user"/>
>   <echo message="Loading${USER}.properties."/>
>   <property file="${USER}.properties"/> 
> To specify a user name on the command line use -DUSER=br.
> HTH Bill
> -----Original Message-----
> From: Mark McKay [] 
> Sent: Saturday, November 05, 2005 4:43 PM
> To:
> Subject: Specifiying user properties file
> I'm trying to set up a situation where my users can specify a properties
> file where they can set properties specific to their machines.  I have 
> main build.xml file checked into my CVS repostiory, and a
> file that is also in the CVS repository.  I'd like the init task of my 
> script to check if a file called exists, and if so to 
> properties from that file.  Otherwise, I'd like it to load properties 
> the file.
> Is there a way to do this (or something similar)?  Ant's lack of an <if>
> task makes setting up something like this difficult.
> Mark McKay
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: For additional
> commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message