三个环境:开发环境,测试环境,上线环境
application-dev.yml
# 开发环境配置
server:
port: 8081
spring:
redis:
host: 127.0.0.1
application-prod.yml
# 上线环境配置
server:
port: 8083
spring:
redis:
host: 127.0.0.3
application-test.yml
# 测试环境配置
server:
port: 8082
spring:
redis:
host: 127.0.0.2
引用一个环境 application.yml
# 引用application-dev配置
spring:
profiles:
active: dev