![](/img/trans.png)
[英]how to access the .properties file in ant if it is in different location
[英]How to change ant property location attribute with .properties file
是否可以使用.properties文件(如属性值属性)更改ant属性位置属性?
ant.xml
<property name="images" location="some_location" />
ant.properties
name=D:\images
请参阅ant手册propertyfile =>,没有称为位置的属性。
属性任务的location属性只是一个值的“特殊”情况,知道如何处理
具有绝对和相对路径。
如果需要编辑| 使用以下任一方法覆盖现有的属性值(位置):
ant脚本任务(建议使用Groovy或Groovy任务)
或某些Flant或Antcontrib之类的Ant插件,为此目的提供了任务。
在构建文件中声明属性将覆盖从属性文件导入的相同值。
唯一的方法是在命令行上设置属性值,如下所示:
ant -Dimages=D:\images
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.