该设置适用于:application.properties 文件

通过创建多个.properties/.yml文件

application.properties 多环境配置 二
按照 application-{value}.properties 格式 即可实现不同环境的切换
在idea中 切换环境设置:
application.properties 多环境配置 二
或者:
application.properties 多环境配置 二
在linux 环境中切换环境:
java -jar xxxxx.jar --spring.profiles.active=test 表示加载测试环境的配置
java -jar xxxxx.jar --spring.profiles.active=pre 表示加载生产环境的配置

相关文章:

  • 2021-08-06
  • 2021-06-15
  • 2021-04-01
  • 2022-01-15
  • 2021-04-08
  • 2021-05-19
  • 2021-06-02
猜你喜欢
  • 2021-05-14
  • 2022-02-15
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
相关资源
相似解决方案