小版本
Spring Cloud 小版本分为:
SNAPSHOT: 快照版本,随时可能修改
M: MileStone,M1表示第1个里程碑版本,一般同时标注PRE,表示预览版版。
SR: Service Release,SR1表示第1个正式版本,一般同时标注GA:(GenerallyAvailable),表示稳定版本。
图片为对应版本号,我们以2017.2月份的Idea为例,默认创建的springboot项目有如下图四个版本
1, Failed to introspect annotated methods on class org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration
现在假如我们选择了1.5.19的版本,那么EurkaServer的版本必须参照上图,示例如下:
如果采用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的版本如下图:
启动的时候就会报出此种异常,解决方案为:
将
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
替换为新版本支持的如下写法:
<dependency>
<!-- Eureka for service registration -->
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
3,java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava
这个异常就是springboot为2.1.12的版本,而springcloud版本不对的情况下报出的异常