启动两个项目
Config-Server
pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
application.properties
server.port=8888
spring.application.name=configServer spring.profiles.active=native
spring.cloud.config.server.native.search-locations=file:D:/properties/
启动配置类
添加@EnableConfigServer
package com.qifan.configserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server