如何引用POM.xml中的环境变量? [英] How to refer environment variable in POM.xml?
本文介绍了如何引用POM.xml中的环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
env
的环境变量。如何在 pom.xml
文件中访问此环境变量的值?解决方案
查看 Maven属性指南 ...
由于Seshagiri在评论中指出, $ {env.variable_name}
会做什么你想要。
我会添加一个警告词,并说一个 pom.xml
应该完全描述你的项目所以请谨慎使用环境变量。如果您的版本取决于您的环境,则难以复制
I am using maven as build tool. I have set an environment variable called env
. How can I get access to this environment variable's value in the pom.xml
file?
解决方案
Check out the Maven Properties Guide...
As Seshagiri pointed out in the comments, ${env.variable_name}
will do what you want.
I will add a word of warning and say that a pom.xml
should completely describe your project so please use environment variables judiciously. If you make your builds dependent on your environment, they are harder to reproduce
这篇关于如何引用POM.xml中的环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文