Spring Cloud Config Client 无法与 Spring Boot 2.5.1 一起使用

vij*_*dey 5 spring-boot spring-cloud-config

Spring Cloud 配置客户端不适用于 Spring Boot 2.5.1,但适用于 2.5.0。

应用程序-dev.yml

spring:
  config:
    import: configserver:http://localhost:8270/
  cloud:
    config:
      enabled: true

Run Code Online (Sandbox Code Playgroud)

错误

***************************
APPLICATION FAILED TO START
***************************

Description:

Config data location 'configserver:http://localhost:8270/' does not exist

Action:

Check that the value 'configserver:http://localhost:8270/' at class path resource [application-dev.yml] - 3:13 is correct, or prefix it with 'optional:'


Run Code Online (Sandbox Code Playgroud)

pom.xml

***************************
APPLICATION FAILED TO START
***************************

Description:

Config data location 'configserver:http://localhost:8270/' does not exist

Action:

Check that the value 'configserver:http://localhost:8270/' at class path resource [application-dev.yml] - 3:13 is correct, or prefix it with 'optional:'


Run Code Online (Sandbox Code Playgroud)

我正在使用 Spring boot 2.4.4 和 Spring Cloud 版本 2020.0.1 运行 Spring Cloud Config Server

And*_*son 2

这是由于Spring Boot 2.4.7 和 2.5.1 中的回归造成的。回归意味着当在特定于配置文件的文件中声明\xe2\x80\x99 时,导入将不起作用。在修复该问题之前,您可以保留较早版本的 Boot 或暂时将导入移至application.yml.

\n