Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct way to use parent environmental variables in maven in Intellij

I have created a Maven Run Configuration in Intellij (Community Edition, Mac, Yosemite), and want to set up an Environmental Variable in the "Runner" tab of the configuration. In the value of that variable, I was wanting to use a parent environmental variable (specifically, $HOME) for part of the value.

For example: Run > Edit Configuration > Add New > Maven > Runner (tab) > Environmental Variables > Add New:

  • name: SOME_CONFIG_FILE
  • value: $HOME/.config/file.json

I have tried with HOME, $HOME, $HOME$, ${HOME} and %HOME% and none of them were able to resolve properly. Clicking on the "Show" for the Parent Environmental Variables show HOME with the proper value.

What is the correct way to set the value?

like image 618
A Sears Avatar asked May 08 '17 03:05

A Sears


People also ask

How do I use environment variables in IntelliJ?

From the main menu, select Run | Edit Configurations or choose Edit Configurations from the run/debug configurations selector on the toolbar. In the Run/Debug Configurations dialog, select a configuration you want to add the environment variables to. Type the variable name and value: <name>=<value> .

How do I create an ENV file in IntelliJ?

Open settings, then select plugins In the search box search for “. env files support” and install it. After restarting IntelliJ you will have a new tab in the Run Configurations screen called EnvFile.


1 Answers

It's not supported at the moment:

  • IDEA-85313 Provide ability to reference parent environment variables in Run Configuration dialog
like image 99
CrazyCoder Avatar answered Oct 01 '22 23:10

CrazyCoder