Nagabhushan S N
Nagabhushan S N

Reputation: 7287

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

Upvotes: 4

Views: 3760

Answers (1)

a3.14_Infinity
a3.14_Infinity

Reputation: 5861

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.

Upvotes: 4

Related Questions