Bill,
Have a read of
http://jakarta.apache.org/ant/manual/CoreTasks/property.html
You have to load the environment values - they are not available
automatically. Check out the environment attribute, in particular.
Conor
> -----Original Message-----
> From: Bill Clinton [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 26 June 2001 9:33 AM
> To: [EMAIL PROTECTED]
> Subject: Can ant read environment variables?
>
>
> Hello,
> I have read in the ant documentation that build files have access
> to environment variables, but I am unable to get this to work. In my
> .bashrc, I have:
>
> WEBAPP=/usr/local/resin-1.2.7/webapps
> export WEBAPP
>
> and when I type "env" I see that this has been set. In my build.xml, I
> have the following two lines:
>
> <property name="webapp.home" value="${WEBAPP}"/>
> <property name="deploy.home" value="${webapp.home}/test"/>
>
> I then use "deploy.home" to copy files etc. But when I build, I get the
> following:
>
> [copy] Copying 11 files to /home/bclinton/work/test/${WEBAPP}/test/WEB-INF
>
> It is creating a directory in my basedir called ${WEBAPP} and copying
> files there. Not exactly what I had in mind. If I set "webapp.home" to
> an absolute path, it works fine. But I would like it so that the same
> buildfile can be used by multiple developers, who would specify
> differences with environmental variables.
>
> Can someone please point out what I am doing wrong here? Or if this is
> a known problem?
>
> One more question: I would have liked to research this question some
> more before asking: is there an archive of the ant-user list? I
> couldn't find one, and I have only been subscribed for around three weeks.
>
> Thanks,
> Bill
>
>
>
>
>