Unable to reference environment variables

99封情书 提交于 2021-01-29 14:42:53

问题


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?


回答1:


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 -->




回答2:


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:

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.



来源:https://stackoverflow.com/questions/63249980/unable-to-reference-environment-variables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!