SpringCloud Config
配置无法读取
问题描述
配置中心的配置文件如下
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
spring:
application:
name: config
cloud:
config:
server:
git:
uri: http://XXX/fjy8018/config-repo
username: 1186032234@qq.com
password: XXX
basedir: spring-cloud\config\basedir
server:
port: 8084
已经通过网页测试该账号和密码可以访问该仓库,并有权限,启动配置中心后通过页面访问提示Cannot clone or checkout repository
解决方法
SpringCloud正式版的配置中心路径必须是带.git结尾的全路径,将配置改为全路径即可
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
spring:
application:
name: config
cloud:
config:
server:
git:
uri: http://XXX/fjy8018/config-repo.git
username: 1186032234@qq.com
password: XXX
basedir: spring-cloud\config\basedir
server:
server:
port: 8084