You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following external application.properties:
spring.profiles.active=dev
my.property=external
and the following src/main/resources/application-dev.properties:
my.property=internal
When running the application, my.property will resolve to internal, whereas documentation clearly states that it should not be so:
Spring Boot uses a very particular PropertySource order that is designed to allow sensible overriding of values, properties are considered in the the following order:
...
6. Application properties outside of your packaged jar (application.properties including YAML and profile variants).
7. Application properties packaged inside your jar (application.properties including YAML and profile variants).
The text was updated successfully, but these errors were encountered:
We might need some clarification in the reference docs as we're not really clear on how profiles effect the ordering. I think that this is actually expected behavior.
Profiles specific config takes precedence over the default config, so in this case the src/main/resources/application-dev.properties profile files will override the external application.properties. If you move my.property=external to an external application-dev.properties I believe that it will work.
@dsyer and @wilkinsona might have more input, but I'm somewhat reluctant to change the current behavior.
Consider the following external
application.properties
:and the following
src/main/resources/application-dev.properties
:When running the application,
my.property
will resolve tointernal
, whereas documentation clearly states that it should not be so:The text was updated successfully, but these errors were encountered: