Cargo Maven 插件令牌替换
我正在使用 Cargo-maven 插件,并且我正在尝试使用该插件的令牌替换功能。不知怎的,它对我不起作用。我想我不知道如何表示令牌,以便货物可以用值替换它。这是我的插件配置
<configfiles>
<configfile>
<file>src/main/resources/test.properties</file>
</configfile>
</configfiles>
<properties>
<dchome>/users/target</dchome>
</properties>
我的 test.properties 的内容如下:
project.home = $dchome
如果有人可以向我展示如何使用货物插件的令牌替换的示例,那就太好了。
谢谢
I am using cargo-maven plugin and I am trying to use token replacement feature of the plugin. Somehow its not working for me. I think I dont know how to represent token so that cargo can replace it with the value. Here is my plugin config
<configfiles>
<configfile>
<file>src/main/resources/test.properties</file>
</configfile>
</configfiles>
<properties>
<dchome>/users/target</dchome>
</properties>
Contents of my test.properties are as follows:
project.home = $dchome
It would be great if any one can show me an example of how to use token replacement of cargo plugin.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,在谷歌搜索解决方案时遇到了这个页面,所以我想我会在这里发布我的解决方案,希望它对其他人有帮助。
最初的发布者接近解决方案 - 他只需使用前导和尾随 AT 符号 (@) 来表示他想要在属性文件中替换的文本。
所以,解决方案非常简单;而不是在 test.properties 文件中执行此操作:
他需要执行此操作:
一旦进行更改,Cargo 插件就能够使用 pom 的“properties”部分中的正确信息来更新属性文件。
I had this same problem, and came across this page while googling for a solution, so I figured I would post my resolution here in the hope it helps someone else.
The original poster was close to a solution - he just had to use a leading and trailing AT symbol (@) to denote the text he wanted to replace in his property file.
So, the solution is pretty straight-forward; instead of doing this in the test.properties file:
He needed to do this instead:
Once that change was made the Cargo plugin was able to update the property file with the correct information from the "properties" section of the pom.