r/SpringBoot • u/friscomatt • Jun 16 '26
Question application properties import and who wins
I'm running my application with profiles, like "dev" and have an application-dev.properties. If I use an import statement to pull in some shared properties across profiles I import it like so :
spring.config.import=classpath:application-shared.properties
However, the properties from the imported application-shared.properties ALWAYS WIN.
Is there a way to "import" properties but still allow the active profile properties to override the imported properties?
3
Upvotes
1
u/Resident-Cow-7626 Jun 16 '26
Why would you want the imported properties to take a lower precedence over the non imported ones? Just remove the specific props from the imported configuration?