Maven变量:美元与Arobase?

发布于 2025-01-21 06:08:26 字数 281 浏览 3 评论 0原文

此文档 @{argline}“。 “ @{argline}”和“ $ {argline}”之间有什么区别?有范围差异吗?

这是在Maven Doc中记录的吗? (找不到...)。

In this documentation, it is suggested to use "@{argLine}". What is the difference between "@{argLine}" and "${argLine}" ? Is there a scope difference ?

Is this documented in maven doc ? (can't find it...).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

小兔几 2025-01-28 06:08:26

@{argline}而不是通常的$ {argline}被称为“后期属性评估”。这仅由Maven Surefire插件支持。

来自

如何使用argline

中其他插件设置的属性

maven在pom.xml中的$ {...}值的属性替换之前,请在运行任何插件之前。因此,Surefire永远不会在其葡萄酒属性中看到地位持有人。

由于版本2.17使用这些属性的替代语法,@{...}允许执行插件后延迟更换属性,因此已通过其他插件修改的属性将是正确地捡起。

@{argLine} instead of the usual ${argLine} is called "late property evaluation". This is only supported by the Maven Surefire Plugin.

From the documentation:

How do I use properties set by other plugins in argLine?

Maven does property replacement for ${...} values in pom.xml before any plugin is run. So Surefire would never see the place-holders in its argLine property.

Since the Version 2.17 using an alternate syntax for these properties, @{...} allows late replacement of properties when the plugin is executed, so properties that have been modified by other plugins will be picked up correctly.

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