我目前有一个spring boot应用。
application.yml
application-dev.yml
在application.yml中,我有
spring:
profiles:
active: dev现在我有多个dev provile的配置,例如。例如dev-1、dev-2和dev-3
我如何配置它?有什么最好的或标准的方法吗?我使用的是2.3.4 spring boot版本
发布于 2020-10-27 21:41:52
您可以使用逗号分隔配置文件,例如
spring:
profiles:
active: dev, dev-1但是,如果您希望添加特定属性而不是覆盖它们,作为The spring.profiles.active property follows the same ordering rules as other properties, the highest PropertySource will win,您可以使用include
spring:
profiles:
active: dev
include:
- dev-1有关更多信息,请参阅documentation
https://stackoverflow.com/questions/64555606
复制相似问题