1.可能是springBoot版本和spingCloud版本不匹配
parent pom做了如下修改
<!--基于springboot开发-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath/>
</parent>
<!--父工程引入springcloud配置-->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Edgware.SR4</version>
<!--Dalston.SR3-->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
子工程中pom添加
<dependency>标签:spring,不可,springframework,pom,starter,org,注解,cloud,EnableEurekaServer From: https://www.cnblogs.com/shuqing0803/p/16952012.html
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
或
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
可参考 :https://blog.csdn.net/weixin_39800144/article/details/83152611/