如何从maven pom访问linux环境变量? [英] How to access linux environment variables from maven pom?
问题描述
我想从pom.xml访问linux环境变量
I want to access linux environment variables from pom.xml
我添加了 WAS_LOCAL_HOST ='http:// localhost:9081'
to
〜/ .bashrc
和〜/ .zsh /rc/env.rc
现在我想从maven的 pom.xml $ c $访问它C>。我尝试过
$ {env.WAS_LOCAL_HOST}
和 $ {WAS_LOCAL_HOST}
,但我的IntelliJ仍将其标记为无法解析符号env.WAS_LOCAL_HOST
Now I want to access it from maven's pom.xml
. I have tried ${env.WAS_LOCAL_HOST}
and ${WAS_LOCAL_HOST}
, but my IntelliJ still marks it as Cannot resolve symbol env.WAS_LOCAL_HOST
如何从maven正确访问此变量?
How to properly access this variable from maven?
推荐答案
在pom中,引用环境变量,比如 MY_VALUE
为 $ {env .MY_VALUE}
。有关详细信息,请查看此链接。
In the pom, refer the environment variable, say MY_VALUE
as ${env.MY_VALUE}
. Check this link for more information.
这篇关于如何从maven pom访问linux环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!