SpringBoot 多环境部署

多个配置文件

  • application.yaml
  • application-dev.yaml
  • application-test.yaml
  • application-prod.yaml

加载顺序

  • 默认加载 application.yaml
  • profiles.active ==dev 合配置

使用不同配置

  • application.yaml 中 profiles.active:dev
  • nohup java -Duser.timezone=Asia/Shanghai -jar -Dspring.profiles.active=prod app.jar > start1.log 2>&1 &
posted @ 2023-05-31 14:55  vx_guanchaoguo0  阅读(6)  评论(0编辑  收藏  举报