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.
MIT License
533 stars 125 forks source link

EnvFile not applied when reading `application.properties` #204

Closed CodingAleCR closed 5 months ago

CodingAleCR commented 1 year ago

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
nevotz commented 1 year ago

happens also to me , intellij 2021.3

CodingAleCR commented 1 year ago

@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. 🙏🏼