起因:使用Spring Cloud Config 搭建Config-Server 和Config-Client
1.Config-Server
application.properties
spring.application.name=micro-weather-config-server
server.port=8089
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
eureka.client.service-url.defaultZone=http://localhost:8081/eureka/
#springcloud config
spring.cloud.config.server.git.uri=https://github.com/wantao666/micro-weather-config
spring.cloud.config.server.git.search-paths=/**
2.通过url访问发现能够访问到git上的配置文件
3.Config-Client
application.properties
spring.application.name=micro-weather-config-server
server.port=8089
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
eureka.client.service-url.defaultZone=http://localhost:8081/eureka/
#springcloud config
spring.cloud.config.server.git.uri=https://github.com/wantao666/micro-weather-config
spring.cloud.config.server.git.search-paths=/**
4.单元测试
@RunWith(SpringRunner.class)
@SpringBootTest
public class