1、 使用springboot的profile命名规则
profile用于多环境的激活和配置,用来切换生产,测试,本地等多套不通环境的配置。如果每次去更改配置就非常麻烦,profile就是用来切换多环境配置的。
在Spring Boot框架中,使用Profile配置文件进行多环境配置时,该配置文件命名必须满足
application-{profile}.properties
比如我们常看到的
application-dev.yml 或者 application-dev.properties
2、application的继承
application-dev.yml会继承application.yml的属性
如 application.yml
spring:
profiles:
active: dev
application: