Issue overriding application properties in Spring-boot (profile-specific) application launched with PropertiesLauncher

后端 未结 1 1917
我寻月下人不归
我寻月下人不归 2021-02-04 08:03

I\'m having difficulty trying to override a property declared in a profile-specific application properties file on the classpath with another value declared in an overrides file

相关标签:
1条回答
  • 2021-02-04 08:51

    Thanks, Dave, your suggestion was 100% correct.

    If I rename the properties file in /local/appname/dev/overrides to application-dev.properties then the property values from that file do override the ones in classpath:application-dev.properties.

    I was sure I had tried this combination yesterday, but I think what must have stopped it working was when I was playing around with specifying the spring.config.location and got that wrong so it wasn't looking for the override file in the right place.

    0 讨论(0)
提交回复
热议问题