渡人自渡 发表于 2018-9-16 10:40:33

spring cloud config git配置的坑

  不多说了,直接上列子
  pom.xml的
  

      org.springframework.cloud
  spring-cloud-config-server
  
  

  yml配置设置
  spring:
  application:
  name: xxx
  cloud:
  config:
  server:
  git:
  uri: git地址
  searchPaths: 子目录
  username: 账号
  password: 密码
  在启动类上增加
  @EnableConfigServer
  最重要的是别加profiles这个属性
  加上这个profiles就会受影响 报错
  You need to configure a uri for the git repository

  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate : Constructor threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'configServerHealthIndicator' defined in>

页: [1]
查看完整版本: spring cloud config git配置的坑