【发布时间】:2021-01-08 08:45:51
【问题描述】:
我尝试启动一个使用库依赖项 (LIB) 的简单 Spring Boot 应用程序 (APP)。
LIB 在根类路径中使用 application.yml 提供公共配置。 APP 通过自己的 application.yml 提供特定的配置,也在根类路径中。
APP启动时,Spring Boot报错找不到某些属性(来自LIB的)。
如果我将 LIB application.yml 移动到类路径中 config/ 下,一切正常。
阅读文档 (https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config-files),不清楚为什么没有加载每个 classpath:/application.yml。这是预期的行为吗?
【问题讨论】:
标签: spring-boot yaml