如何使用 .properties 文件更改 ant 属性位置属性

发布于 2025-01-05 01:08:46 字数 210 浏览 6 评论 0原文

是否可以使用 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

纸短情长 2025-01-12 01:08:46

参见ant手册 propertyfile =>没有名为位置的属性。
属性任务中的位置属性只是值的“特殊”情况,知道如何处理
绝对和相对路径。
如果您需要编辑|使用以下任一方法覆盖现有属性值(位置):
ant脚本任务(推荐groovy或groovy任务)
或一些 Ant 插件,例如 FlakaAntcontrib,为此目的提供任务。

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.

二货你真萌 2025-01-12 01:08:46

在构建文件中声明属性将覆盖从属性文件导入的相同值。

执行此操作的唯一方法是在命令行上设置属性值,如下所示:

ant -Dimages=D:\images

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:

ant -Dimages=D:\images
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文