springcloud 整合config server 报错org.springframework.cloud.config.server.environment.NoSuchRepositoryEx

springcloud 整合config server 报错org.springframework.cloud.config.server.environment.NoSuchRepositoryException: Cannot clone or checkout repository

今天学到springcloud ,其中整合config
application.yml 配置如下:

server:
  port: 3344
spring:
  application:
    name: cloud-config-center    #注册进eureka服务
  cloud:
    config:
      server:
        git:
          uri: https://github.com/xxx/SpringCloud.git    #GitHub仓库名
          #          搜索目录
          search-paths:
            - SpringCloud
          skip-ssl-validation: true
      #      读取分支
      label: master
eureka:
  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
      defaultZone: http://localhost:7001/eureka/
#      集群版
#      defaultZone: http://localhost:7001/eureka/,http://localhost:7002/eureka/

然后访问 http://localhost:3344/xxx/SpringCloud/master/config-test.yml 是出现错误
页面报错情况
最后各种百度查资料,结果是权限问题,需要我们在application.yml 文件中添加 账户和密码

server:
  port: 3344
spring:
  application:
    name: cloud-config-center    #注册进eureka服务
  cloud:
    config:
      server:
        git:
          uri: https://github.com/hj950818/SpringCloud.git    #GitHub仓库名
          #          搜索目录
          search-paths:
            - SpringCloud
          skip-ssl-validation: true
          username: xxxxx
          password: xxxxx
      #      读取分支
      label: master
eureka:
  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
      defaultZone: http://localhost:7001/eureka/
#      集群版
#      defaultZone: http://localhost:7001/eureka/,http://localhost:7002/eureka/

然后再次访问结果如下:http://localhost:3344/hj950818/SpringCloud/master/config-test.yml
地址结果

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值