Maven 可以忽略丢失的系统属性吗?
如果我的 pom 文件中有以下内容:
<properties>
<mySystemProperty>${mySystemProperty}</mySystemProperty>
</properties>
当我使用“mvn clean install -DmySystemProperty=someData”构建时,它会成功构建。如果我使用“mvn clean install”构建它,我不需要指定系统属性,Maven 会给我这个错误:
Resolving expression: '${mySystemProperty}': Detected the following recursive expression cycle in 'mySystemProperty'
有没有办法让 maven 忽略丢失的系统属性?如果没有的话有办法默认吗?
If I have the following in my pom file:
<properties>
<mySystemProperty>${mySystemProperty}</mySystemProperty>
</properties>
When I build using "mvn clean install -DmySystemProperty=someData", it builds successfully. If I build it using "mvn clean install", where I don't need to specify the system property, Maven gives me this error:
Resolving expression: '${mySystemProperty}': Detected the following recursive expression cycle in 'mySystemProperty'
Is there a way to get maven to ignore the missing system property? If not, is there a way to default it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了。系统变量和 maven 变量使用相同的名称导致了问题。重命名系统变量修复了错误。
Solved it. Using the same name for the system variable and maven variable caused the problem. Renaming the system variable fixed the error.