我正在学习 Spring Cloud 并使用 spring 版本 2.4.3 和 spring-cloud-version
2020.0.1 和我创建了两个属性文件
应用程序.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.yml文件吗?
我遇到了同样的问题。我的项目没有bootstrap.yml,但是我在IDEA的启动配置中指定了一个dev事件文件,导致了和你一样的错误。启动时报错找不到bootstrap.yml。 IDEA启动配置中删除dev后,可以正常启动。
关于spring - 配置服务器配置无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66690015/