<dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> </dependency> </dependencies>
package com.eureka; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * @author yourheart * @Description * @create 2021-06-16 23:04 */ @SpringBootApplication @EnableEurekaServer public class EurekaOneApplication { public static void main(String[] args) { SpringApplication.run(EurekaOneApplication.class,args); } }
server.port=8762 spring.application.name=springcloud-eureka eureka.instance.hostname=localhost eureka.client.service-url.defaultZone=http://${eureka.instance.hostname}:8762 eureka.client.register-with-eureka=false eureka.client.fetch-registry=false
以上就是子工程创建的全部,该子工程需要依赖父工程,父工程查看如下链接
原文:https://www.cnblogs.com/q202105271618/p/14891557.html