Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant 属性将被以后的属性文件覆盖吗?_Ant - Fatal编程技术网

Ant 属性将被以后的属性文件覆盖吗?

Ant 属性将被以后的属性文件覆盖吗?,ant,Ant,如果我有两个要加载的属性文件,并且两个文件都包含相同的属性${Product.Version},那么在build.xml脚本中将考虑这些属性,为什么 build.xml ... <property file="sort.properties" /> <property file="master.properties" /> ... <echo message="${Product.Version} /> 主属性 Product.Version = 7.00

如果我有两个要加载的属性文件,并且两个文件都包含相同的属性${Product.Version},那么在build.xml脚本中将考虑这些属性,为什么

build.xml

...
<property file="sort.properties" />
<property file="master.properties" />
...
<echo message="${Product.Version} />
主属性

Product.Version = 7.00
Product.Version = 6.00

Product.Version将等于7.0,一旦在ant中设置了属性,它将不会被稍后在脚本中设置该属性的另一次尝试所覆盖。

Product.Version将等于7.0,在ant中设置属性后,脚本中稍后设置属性的另一次尝试不会覆盖该属性。

如果需要在设置属性后更改属性值,可以使用中的
var
任务,如果需要在设置属性后更改属性值,您可以从中使用
var
任务