ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EnvFile not applied when reading `application.properties`

CodingAleCR opened this issue · comments

I have a Spring Boot application running with configurations set in application.properties pointing to env vars in a .env file. However, when running the project, it does not recognize the environment variables. This used to work a while back (a couple of years ago) but now it does not.

Here's an example of how it's setup:

.env

SOME_ENV_VAR=mysecretvalue

application.properties

some.config.envvar=${SOME_ENV_VAR}

If I substitute all values in the application.properties for the ones in .env then the project runs just fine.

IDE: IntelliJ CE
Configuration Type: Gradle task or Application
EnvFile settings:
Screen Shot 2022-11-30 at 18 18 20

commented

happens also to me , intellij 2021.3

@nevotz in my case it was solved by upgrading Gradle on my project.

I understand this is not the best solution or something that everyone can do on their projects but I hope it helps. 🙏🏼