简体   繁体   English

Intellij没有在pom.xml中识别环境变量

[英]Intellij not recognising environment variable in pom.xml

In my maven project, I have a dependency on a jar that will be present in a certain location within system and not in a repository. 在我的maven项目中,我依赖于一个jar,它将出现在系统内的某个位置,而不是存储库中。 So, I'm using SystemPath for the dependency in pom.xml. 所以,我在pom.xml中使用SystemPath作为依赖项。 But the systemPath is dependent on a environment variable. 但systemPath依赖于环境变量。 But Intellij is not recognising the environment variable. 但是Intellij没有认识到环境变量。 I even tried setting the path using 我甚至尝试使用路径设置

<systemPath>${HOME}/dir1/dir2/abc.jar</systemPath>

But Intellij is not even recognising the $HOME variable. 但Intellij甚至没有认识到$ HOME变量。 But if I give the absolute path like 但是,如果我给出绝对的路径

<systemPath>/Users/myuser/dir1/dir2/abc.jar</systemPath>

Intellij is picking it up properly. Intellij正在捡起它。 Any idea how to resolve this? 知道如何解决这个问题吗?
Thanks 谢谢

Environment Variables can be referred in pom.xml using 'env.' 可以使用'env'在pom.xml中引用环境变量。 prefix. 字首。

Please refer to Maven properties 请参阅Maven属性

For example, 例如,

env.PATH

Contains the current PATH in which Maven is running. 包含Maven运行的当前PATH。 The PATH contains a list of directories used to locate executable scripts and programs. PATH包含用于查找可执行脚本和程序的目录列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM