ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <>
Subject RE: Retrieving key value pairs from URL and setting as system property
Date Wed, 19 Mar 2008 12:30:57 GMT

setting the env variables =

<property name="env.FOO="/path/to/foo"/>
<property name="env.BAR" value="/path/to/bar"/>

accessing the env variables =

<property environment="env"/>
<echo>$${env.FOO} == ${env.FOO}</echo>
<echo>$${env.BAR} == ${env.BAR}</echo>

other already set env variables are also accessible

<echo>$${env.JAVA_HOME} == ${env.JAVA_HOME}</echo>
<echo>$${env.TOMCAT_HOME} == ${env.TOMCAT_HOME}</echo>

when using <property prefix="..."/> the variables are only
living in the scope of your ant script.

Maybe you want to set your variables in a wrapper start script
for your ant scripts, f.e.

@ echo off

set ANT_OPTS=-Xmx1024m
set ANT_HOME=C:\ant
set JAVA_HOME=C:\Programme\JavaSoft\JDK\1.5.0_11
set PATH=%JAVA_HOME%\bin;%PATH%;%ANT_HOME%\bin;C:\cvsnt;C:\ant_extralibs

call ant -f  %1

:call ant -debug -f  %1

:call ant -listener -f  %1

: Performance Monitoring
:call ant -listener ise.antelope.common.AntPerformanceListener -f  %1


Regards, Gilbert

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

View raw message