@EnableEurekaServer注解不可用

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>
<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/
posted @ 2022-12-05 13:10  baihehua  阅读(144)  评论(0)    收藏  举报