springcloud配置config报错:If you are using the git profile, you need to set a Git URI in your configurat

server:
  port: 3344

spring:
  application:
    name: cloud-config-center #注册进Eureka服务器的服务名称
  #config的相关配置(注意层级,是在spring下层的)
    cloud:
      config:
        server:
          git:
            skipSslValidation: true #跳过ssl认证
            uri: https://github.com/weifing/springcloud-config.git
            search-paths:  #搜索目录
              - springcloud-config
        label: master   #读取分支

如上是config的相关配置,配置了远程仓库,启动时,无法启动,报如下的异常:

报错提示:如果配置了git仓库,要添加git uri路径,无法读取到配置的uri。

解决方法: 

要在spring.cloud层级下面添加远程仓库uri,更正后的config配置

server:
  port: 3344

spring:
  application:
    name: cloud-config-center #注册进Eureka服务器的服务名称
  #config的相关配置(注意层级,是在spring下层的)
  cloud:
    config:
      server:
        git:
          skipSslValidation: true #跳过ssl认证
          uri: https://github.com/weifing/springcloud-config.git
          search-paths:  #搜索目录
            - springcloud-config
      label: master   #读取分支

#服务注册到eureka地址
eureka:
  client:
    service-url:
      defaultZone: http://eureka7001.com:7001/eureka

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值