• 多环境配置的好处:

1.不同环境配置可以配置不同的参数

2.便于部署,提高效率,减少出错

 

  • Properties多环境配置

1. 配置**选项

spring.profiles.active=dev

2.添加其他配置文件

Spring Boot教程(3)-配置文件-多环境配置

Spring Boot教程(3)-配置文件-多环境配置

可以看到端口号不一样。启动项目

Spring Boot教程(3)-配置文件-多环境配置

git地址:https://github.com/itwsj/springbootdemo

 

相关文章:

  • 2021-11-30
  • 2021-07-03
  • 2021-08-24
  • 2021-11-19
  • 2018-03-26
猜你喜欢
  • 2021-09-12
  • 2021-07-20
  • 2021-09-18
  • 2022-01-19
  • 2021-11-15
  • 2021-08-07
  • 2021-11-23
相关资源
相似解决方案