【发布时间】:2021-06-15 18:58:04
【问题描述】:
我正在学习 Spring Cloud 并使用 spring 版本 2.4.3 和 spring-cloud-version
2020.0.1 和我创建了两个属性文件
application.yml
spring:
application:
name: cloud-server
server:
port: 8888
bootstrap.yml
spring:
cloud:
config:
server:
git:
uri: https://github.com/************/insurance-config-server
default-label: main
但我仍然收到以下错误
***************************
APPLICATION FAILED TO START
***************************
Description:
Invalid config server configuration.
Action:
If you are using the git profile, you need to set a Git URI in your configuration. If you are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.
如何解决这种错误?
【问题讨论】:
-
希望我没有弄乱您想要的任何格式。你的尝试非常难以理解......
-
您不再需要 bootstrap.properties。请看教程spring.io/guides/gs/centralized-configuration
-
对于 2020.0 的引导程序不再需要,将配置移至 application.yml
标签: spring spring-boot spring-mvc spring-cloud spring-cloud-config