0
点赞
收藏
分享

微信扫一扫

07 点积

cwq聖泉寒江2020 2023-11-05 阅读 50

1.yml文件(旧)

说明:旧的写法。

#应用环境
spring:
  profiles:
    active: dev
---
#设置环境


#生产环境
spring:
  profiles: pro
server:
  port: 81

---
#开发环境
spirng:
  profiles: dev
server:
  port: 81


---
#测试环境
spring:
  profiles: test
server:
  port: 82

2. yml文件(新)

说明:以下是最新配置。

#应用环境
spring:
  profiles:
    active: test
---
#设置环境


#生产环境
spring:
  config:
    activate:
      on-profile: pro
server:
  port: 81

---
#开发环境
spring:
  config:
    activate:
      on-profile: dev
server:
  port: 81


---
#测试环境
spring:
  config:
    activate:
      on-profile: test
server:
  port: 82

举报

相关推荐

0 条评论