如何从maven pom访问linux环境变量? [英] How to access linux environment variables from maven pom?

查看:839
本文介绍了如何从maven pom访问linux环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从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 。我尝试过 $ {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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆