【发布时间】:2020-07-20 20:43:04
【问题描述】:
为了配置 Spring Boot 应用程序,我可以通过将文件放在 spring 扫描此类文件的位置之一(./config/、cwd、类路径)来控制加载哪个配置/属性文件(比如说application.yml) :config/,类路径根)。我还可以使用 CLI (spring.config.location) 或环境变量指向特定位置。
我如何才能找出运行时属性文件的最终加载位置?我想检查用户是否指定/使用了他自己的配置文件,或者是否使用了提供的配置文件。
我正在使用 spring 5.2.2 和 springboot 2.2.2。
【问题讨论】:
标签: java spring spring-boot configuration