下载spring的模板
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client </artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
注册中心和springboot依赖
2新建分支system,spring boot项目
将system注入到eureka服务
application.properties
spring.application.name=system server.servlet.context-path=/system server.port=9001 eureka.client.service-url.defaultZone= http://localhost:8761/eureka/
启动类加一个注解
@EnableEurekaClient