ANT question regarding Env Variable?

R

R

I have an ANT build file that is shared among many programmers that
has this in it...
....
<property name="jboss.deploydir"
location="C:\programming\jboss-3.2.0\server\default\deploy\"/>
....

My question: Not every developer in my group has the jboss-3.2.0/
directory underneath "/programming". If I was to setup a system
"evironment" variable called "JBOSS_HOME", how could I change my build
to use the contents of this variable instead of hardcoding the
"c:programming\jboss-3.2.0....".

I know this is a newbie question... but I've checked the Jakarta
project for docs and it still isn't clear. BTW, I'm using ANT via
Eclipse 2.1.0

Thanks!!!
 
D

David Zimmerman

R said:
I have an ANT build file that is shared among many programmers that
has this in it...
...
<property name="jboss.deploydir"
location="C:\programming\jboss-3.2.0\server\default\deploy\"/>
...

My question: Not every developer in my group has the jboss-3.2.0/
directory underneath "/programming". If I was to setup a system
"evironment" variable called "JBOSS_HOME", how could I change my build
to use the contents of this variable instead of hardcoding the
"c:programming\jboss-3.2.0....".

Put these lines near the top of your build.xml

<!-- use global properties for this build -->
<property environment="ENV"/>

They instruct ant to map all the environment variables to the prefix
'ENV' (which you can change)

Then you can reference any environment variable by preceding it with
that prefix, EG location="$ENV.JBOSS_HOME\server\default\deploy"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top