intellij idea: defined environment variable not recognized in maven pom Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of intellij idea: defined environment variable not recognized in maven pom without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I have a java project opened in IntelliJ IDEA version 2018.1

I have defined an environment variable MY_VAR as /some/path/here in File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Runner -> Environment Variables

In my pom.xml, in the properties secion, I have defined my property as

<myProperty>${env.MY_VAR}/morepath</myProperty>

However, IntelliJ IDEA complains that “Cannot resolve symbol ‘env.MY_VAR'”

Answer

The possible two workarounds:

Setting the variable from terminal:

set env MY_VAR /some/path/here

Then restart your IDE.


Another options is to add export MY_VAR=/some/path/here ~/.profile file.
Then restart your computer.

We are here to answer your question about intellij idea: defined environment variable not recognized in maven pom - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji