springcloud与springboot版本配合问题记录

springcloud与springboot版本配合问题记录_第1张图片

小版本

Spring Cloud 小版本分为:

SNAPSHOT: 快照版本,随时可能修改

M: MileStone,M1表示第1个里程碑版本,一般同时标注PRE,表示预览版版。

SR: Service Release,SR1表示第1个正式版本,一般同时标注GA:(GenerallyAvailable),表示稳定版本。

图片为对应版本号,我们以2017.2月份的Idea为例,默认创建的springboot项目有如下图四个版本

springcloud与springboot版本配合问题记录_第2张图片

1, Failed to introspect annotated methods on class org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration

现在假如我们选择了1.5.19的版本,那么EurkaServer的版本必须参照上图,示例如下:

springcloud与springboot版本配合问题记录_第3张图片

如果采用Brixton.RELEASE的话,则会在springboot启动类上加上@EnableEurekaServer注解启动的时候报出 Failed to introspect annotated methods on class org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration异常

2,@enableeurekaserver 无法引入

现在假如我们采用springboot2.1.2.RELEASE版,springcloud的版本如下图:

springcloud与springboot版本配合问题记录_第4张图片

启动的时候就会报出此种异常,解决方案为:


   org.springframework.cloud
   spring-cloud-starter-eureka-server

替换为新版本支持的如下写法:


   
   org.springframework.cloud
   spring-cloud-starter-netflix-eureka-server

3,java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.([Ljava

这个异常就是springboot为2.1.12的版本,而springcloud版本不对的情况下报出的异常

你可能感兴趣的:(springcloud)