外部配置文件所在目录path/to/dir

指定--spring.config.location=path/to/dir

项目启动,没有使用任何配置文件,项目外和jar包中的都没有使用

 

这是因为其把path/to/dir当成一个文件读取,没有读取到任何内容

 

指定--spring.config.location=path/to/dir/application-{profile}.yml 可以

指定--spring.config.location=path/to/dir/ 也可以,这是会按优先级顺序,读取目录下所有配置文件

 

相关文章:

  • 2021-03-31
  • 2021-06-07
  • 2021-08-17
  • 2021-09-27
  • 2021-11-23
  • 2022-01-01
  • 2022-03-03
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案