Hi there. I was migrating from Spring Boot 1.5.4.RELEASE to 2.0.0.M6 and I notice that when I use:
--spring.config.location=app.properties
To specify other config file to overwrite some properties (production ones), it completely replaces the properties, "erasing" the default ones on the application.properties file. Is this intended behavior or a bug?
Thanks!
Comment From: wilkinsona
It is intended: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-M6-Release-Notes#configuration-location
Comment From: samuelbirocchi
@wilkinsona is there a way to use the same way as it was before?
Comment From: wilkinsona
Yes. From the release notes to which I linked above:
If you were relying on the way it was handled previously, you should now use
spring.config.additional-location
instead.
Comment From: samuelbirocchi
Ops my bad, I tried that before and got no results, tried now and it worked, must been a typo.
Thanks 😄
Comment From: softKarma
Is there any condition were --spring.config.location reverts to the old behavior?
Comment From: wilkinsona
@softKarma No, I don’t believe so.
Comment From: softKarma
We have a deployment env which uses this property to provide the config location. For our application it worked as expected and we had to use spring.config.additional-location
so that it picks the defaults as well, however for another application in that env which has the same spring boot version i.e. 2.2.5.RELEASE
spring.config.location is behaving the old way. So I am still wondering how that is happening for e.g. due to some other dependency.
Comment From: wilkinsona
@softKarma We can help you to figure that out, but this isn't the right place to do so. If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.