Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

RE: Retrieving key value pairs from URL and setting as system property

Rebhan, Gilbert

2008-03-19

Replies:



...
/*
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

: DEFAULT
call ant -f %1

: DEBUG
:call ant -debug -f %1

: XML LOGGER
:call ant -listener org.apache.tools.ant.XmlLogger -f %1

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

pause


Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.