我定义了2个env vars:
myuser@mymachine:~$ echo $ANT_HOME
/home/myuser/apache/ant/1.8.4/apache-ant-1.8.4
myuser@mymachine:~$ echo $ANT_IVY_HOME
/home/myuser/apache/ivy/apache-ivy-2.3.0-rc2
我有以下Ant构建:
<property environment="env"/>
<target name="testant">
<echo message="Ant home: ${env.ANT_HOME}"/>
<echo message="Ant ivy home: ${env.ANT_IVY_HOME}"/>
</target>
当我运行testant
时,我得到以下控制台输出:
Buildfile: /home/myuser/eclipse/workspace/myapp/build.xml
testant:
[echo] Ant home: /home/myuser/apache/ant/1.8.4/apache-ant-1.8.4
[echo] Ant ivy home: ${env.ANT_IVY_HOME}
BUILD SUCCESSFUL
Total time: 316 milliseconds
为什么Ant会识别ANT_HOME
而不识别ANT_IVY_HOME
?提前谢谢!
答案 0 :(得分:2)
您是否仅设置ANT_IVY_HOME
而非导出吗?