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