我定义了 2 个环境变量:
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
?提前致谢!