JLee101
JLee101

Reputation: 93

Unable to reference environment variables

Anyone know why I am unable to reference the User environment variables shown below (red box) but I am able to reference the System environment variables (green box) without any issues?

???

Upvotes: 0

Views: 568

Answers (2)

JLee101
JLee101

Reputation: 93

Ok so, in short, they need to be placed in <environmentVariables>ENVIRONMENT VARIABLES GO HERE </environmentVariables> within the POM for them to be picked up. As @Andrey pointed out in his reply, they do show as unresolved but will still work. You can stop them showing as unresolved using: <!--suppress UnresolvedMavenProperty -->

Upvotes: 1

Andrey
Andrey

Reputation: 16381

IDE provides only some of the pre-defined environment variables for completion and validation. Other variables may be not resolved. For the error not to be reported you can use intention action to suppress it:

enter image description here

Also note that when defined in Run Configuration in IDE - the environment variables are only defined for this particular session that you launch using this configuration.

If you want for the environment variables to be picked up in pom.xml file you need to define it in the OS.

Upvotes: 0

Related Questions