问题描述:单独使用 springboot 组件时,bootstrap.yml 配置文件无法生效?
解决方案: springboot 本身不支持,需要和 springcloud 组件结合,加上 spring cloud context 依赖即可。
在 pom 文件中引入
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
注意: 这里使用的 springboot 版本为: 2.0.9.RELEASE
完美解决!