简体   繁体   中英

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. So, I'm using SystemPath for the dependency in pom.xml. But the systemPath is dependent on a environment variable. But Intellij is not recognising the environment variable. I even tried setting the path using

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

But Intellij is not even recognising the $HOME variable. But if I give the absolute path like

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

Intellij is picking it up properly. Any idea how to resolve this?
Thanks

Environment Variables can be referred in pom.xml using 'env.' prefix.

Please refer to Maven properties

For example,

env.PATH

Contains the current PATH in which Maven is running. The PATH contains a list of directories used to locate executable scripts and programs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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