Ant Exec environment var

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-28T20:18:38Z Indexed on 2010/05/28 20:22 UTC
Read the original article Hit count: 220

Filed under:

I have a problem where I don't want to have to call a setEnv.sh file before i call my ant target that calls an exec task.

Right now I have a way to save the environment variables in setenv.properties file in the key=value notation.

The exec task for some reason does not see the variables that are set in the .properties file.... (I know i could use the tag but the setenv.properties is dynamically generated)

setenv.properties:

HELLO=XYZ

part of my build.xml :

<property file="setenv.properties"/>
<target name="test" depends="setEnv">
   <exec  executable="/bin/ksh" newenvironment="false">

test.sh :

echo ${HELLO}

Any thoughts?

© Stack Overflow or respective owner

Related posts about ant