(1)新建
(2)依赖
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
</dependencies>
(3)bootstrap配置
spring:
cloud:
config:
name: microservice-config-eureka
profile: dev
label: master
uri: http://localhost:5001
(4)application yml
spring:
application:
name: microservice-eureka-config
(5)启动类
@SpringBootApplication
@EnableEurekaServer
public class EurekaServer_Config_6001 {
public static void main(String[] args) {
SpringApplication.run(EurekaServer_Config_6001.class,args);
}
}
(6)效果