SpringBoot的多环境支持的几种配置
1.application.properties 的配置 :
使用其命名规范进行配置 : 创建 application-xxx.properties , 在 application.properties 中使用 spring.profiles.active = xxx 进行激活
2.application.yml 的配置
使用 yml 文件的块区分多环境 : 分隔符 - - - , 具体实例如下
server:
port: 8082
spring:
profiles:
active: dev
---
server:
port: 8083
spring:
profiles: dev