SpringBoot 中profile的支持

A.application.properties文件的配置

1.配置profile
SpringBoot 中profile的支持
SpringBoot 中profile的支持
2.**profile
方法一:通过主配置文件**,如下图
SpringBoot 中profile的支持
方法二:右键进入edit configuration
SpringBoot 中profile的支持
SpringBoot 中profile的支持
其他场景:同时运行两个环境
SpringBoot 中profile的支持

B.application.yml文件的配置

SpringBoot 中profile的支持
SpringBoot 中profile的支持

C.外部配置的优先加载,优先级更高如下图对比可知

SpringBoot 中profile的支持

SpringBoot 中profile的支持
SpringBoot 中profile的支持

D.application.properties比application.yml优先级高

SpringBoot 中profile的支持

相关文章:

  • 2021-08-22
  • 2021-12-02
  • 2021-10-11
  • 2021-07-30
  • 2022-12-23
  • 2021-04-10
  • 2023-01-19
  • 2022-12-23
猜你喜欢
  • 2021-07-17
  • 2021-10-29
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2021-10-08
  • 2021-08-09
相关资源
相似解决方案