SpringBoot支持bootstrap.yml/bootstrap.properties配置文件,需要导入spring-cloud-starter-bootstrap依赖

2025-10-01 13:25:59

说明:

在SpringBoot 2.4.x版本之后,对于bootstrap.properties/bootstrap.yaml配置文件的支持,需要导入如下依赖:

org.springframework.cloud

spring-cloud-starter-bootstrap

3.1.3

注意:

1、导入依赖后,还需要开启 spring.cloud.bootstrap.enabled=true

2、spring cloud starter alibaba nacos config,引用这个配置中心的依赖后,需要使用bootstrap.yml或bootstrap.properties 作为中转配置文件

3、不同类型配置文件读取优先级:bootstrap.yml/bootstrap.properties > application.yml/application.properties

《DNF》110版本材料囤积推荐
连字五行属什么