1,先创建config-server 项目配置如下
package com.hcmony;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@EnableConfigServer
@SpringBootApplication
public class ConfigApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigApplication.class, args);
}
}
eureka.client.service-url.defaultZone= http://localhost:8888/eureka/
#config-server对外提供的端口
server.port=8200
spring.application.name=config-server
#git repo的url地址
spring.cloud.config.server.git.uri=https://github.com/hcmony/config.git
spring.cloud.config.server.git.search-paths=/dev
spring.cloud.config.label=master
#spring.cloud.config.server.git.username=
#spring.cloud.config.server.git.password=
<?xml version="