springboot根据spring.profiles.active会去寻找应该加载开发环境配置还是生产环境配置

 

application.properties

#生产环境,开发环境,测试环境切换  prod/dev/test
spring.profiles.active=prod

#返回页面日期时,格式化
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
#前台时区和后台时区同步
spring.jackson.time-zone=GMT+8 

application-dev.properties

server.port=8090

application-prod.properties

server.port=9998

application-test.properties

server.port=8092

 

如图:

微服务-springboot多环境配置(开发生产测试环境切换)

 

 

 

 

demo地址:https://github.com/qjm201000/microservice_manyenviroment.git

相关文章:

  • 2021-11-05
  • 2022-12-23
  • 2021-06-24
  • 2021-06-16
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2021-06-24
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
相关资源
相似解决方案