1. 再同一个yml中配置多文档块。
1.1 创建要给文件application.yml
1.2 再application.yml中编写多文档块。
spring:
profiles:
active: uat
---
spring:
profiles: uat
server:
port: 8888
---
spring:
profiles: dev
server:
port: 8886
1.3 启动项目测试结果。
2.1 不同的环境配置不同的配置文件。
启动测试:
3. 通过运行参数配置profile。