Closed aBnormaLz closed 3 years ago
Hi @aBnormaLz
Firstly, the concept of .env
in general is to abandon "profiles", please read the second last paragraph of https://12factor.net/config
Having said that, I spun up an example and verified that profiles are working correctly. I was able to run my Spring Boot application with a "dev" profile and have an application-dev.properties file which was correctly picked up as one would expect.
I see this in your logs m.p.springdotenv.DotenvPropertySource : Getting env property for 'env.SPRING_PROFILES_ACTIVE'
This is not the correct usage of the .env
pattern.
Feel free to reopen this thread if you'd like to discuss it further.
Seems Spring doesn't load the proper application.properties file according to the profile. After the application started it succesfully overrides the
spring.profiles.active
so the following variable's value isdev
in runtimeYou can see the log here, hope it helps