Ant in Action读书笔记(一):Ant里的Property是immutable的

Ant里的property和Java里的变量是不太一样,它是immutable,也就是不能改变的。
所以说如果你在build.xml里定了一个search.string的property两遍。运行后的结果是只会输出第一次设定的结果。这个是以前没有注意到的。
<target name="test">
  <property name="search.string" value="DETECTED POTENTIAL MEMORY LEAK"/>
  <property name="search.string" value="fake the build"/>
  <echo>${search.string}</echo>
</target>
原文地址:https://www.cnblogs.com/buhaiqing/p/2752140.html