如何使用 .properties 文件更改 ant 属性位置属性
是否可以使用 .properties 文件更改 ant 属性位置属性,例如 属性值属性?
ant.xml
<property name="images" location="some_location" />
ant.属性
name=D:\images
Is it possible to change ant property location attribute with .properties file like
property value attribute?
ant.xml
<property name="images" location="some_location" />
ant.properties
name=D:\images
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
参见ant手册 propertyfile =>没有名为位置的属性。
属性任务中的位置属性只是值的“特殊”情况,知道如何处理
绝对和相对路径。
如果您需要编辑|使用以下任一方法覆盖现有属性值(位置):
ant脚本任务(推荐groovy或groovy任务)
或一些 Ant 插件,例如 Flaka 或 Antcontrib,为此目的提供任务。
See ant manual propertyfile => there is no attribute called location.
The location attribute from property task is only a 'special' case of a value, that knows how to deal
with absolute and relative pathes.
If you need to edit | overwrite existing property values(locations) use either :
ant script task (groovy or groovy task recommended)
or some Ant addon like Flaka or Antcontrib, providing tasks for that purpose.
在构建文件中声明属性将覆盖从属性文件导入的相同值。
执行此操作的唯一方法是在命令行上设置属性值,如下所示:
Declaring a property within the build file will override the same value imported from a properties file.
The only way to do this is setting the property value on the command-line as follows: