Spring boot version: 2.5.0
I've different property files. 3 inside the jar and one on the server (for overriding the properties with server specific)
- application.properties
- application-dev.properties
- application-prod.properties
The active profile and external properties' path is configured in the application.properties.
spring.profiles.active=@prodProfile@
spring.config.import=optional:file:./application-local.properties
Where the values of @prodProfile@ is coming from the profile configuration part of pom.xml.
<properties>
<prodProfile>prod</prodProfile>
</properties>
If I have same properties in application-prod.properties and application-local.properties, which has precedence? When I tested, I've found that profile specific has precedence. Not able to override the property value with spring.config.import. Is it expected behavior?