EnableEurekaServer 注解无法导入问题

最近再添加eureka依赖时

总是无法成功引入

导致程序@enableeurekaserver报错

最终找到原因是springboot与springcloud的支持版本不一致

修改pom.xml

<dependencies>
   <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
   </dependency>
   <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
   </dependency>
 
</dependencies>
 
   <dependencyManagement>
       <dependencies>
           <dependency>
               <groupId>org.springframework.cloud</groupId>
               <artifactId>spring-cloud-dependencies</artifactId>
               <version>Finchley.RELEASE</version>
               <type>pom</type>
               <scope>import</scope>
           </dependency>
       </dependencies>
   </dependencyManagement>
后成功运行

 

版本号规则
Spring Cloud并没有熟悉的数字版本号,而是对应一个开发代号。

Cloud代号Boot版本(train)    Boot版本(tested)   lifecycle
Angle1.2.xincompatible with 1.3EOL in July 2017
Brixton 1.3.x1.4.x2017-07卒
Camden    1.4.x1.5.x-
Dalston    1.5.xnot expected 2.x-
Edgware1.5.xnot expected 2.x-
Finchley    2.xnot expected 1.5.x -


开发代号看似没有什么规律,但实际上首字母是有顺序的,比如:Dalston版本,我们可以简称 D 版本,对应的 Edgware 版本我们可以简称 E 版本

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值