springcloud的Hoxton.SR6启动报错NoClassDefFoundError: com/fasterxml/jackson/databind/JsonSerializer

最近用官方文档的 POM 建springcloud工程。
springboot版本2.3.1
springcloud版本Hoxton.SR6
spring版本:spring-5.2.7.RELEASE

	
		org.springframework.boot</groupId>
		spring-boot-starter-parent</artifactId>
		2.3.1.RELEASE</version>
		/> <!-- lookup parent from repository -->
	</parent>
	com.example</groupId>
	Eureka.Server</artifactId>
	0.0.1-SNAPSHOT</version>
	Eureka.Server</name>
	Demo project for Spring Boot</description>

	
		.version>1.8</java.version>
		-cloud.version>Hoxton.SR6</spring-cloud.version>
		.version>2.10.0</jackson.version><!-- no effect -->
	</properties>

	
		
			org.springframework.cloud</groupId>
			spring-cloud-starter-netflix-eureka-server</artifactId>
		</dependency>

启动报错:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
springcloud的Hoxton.SR6启动报错NoClassDefFoundError: com/fasterxml/jackson/databind/JsonSerializer_第1张图片
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.Versioned
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_92]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_92]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_92]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_92]
… 83 common frames omitted
springcloud的Hoxton.SR6启动报错NoClassDefFoundError: com/fasterxml/jackson/databind/JsonSerializer_第2张图片
试了很久发现在properties加入version无效
springcloud的Hoxton.SR6启动报错NoClassDefFoundError: com/fasterxml/jackson/databind/JsonSerializer_第3张图片
要直接添加jackson依赖替换 springboot自带的2.11.0才有效果:
springcloud的Hoxton.SR6启动报错NoClassDefFoundError: com/fasterxml/jackson/databind/JsonSerializer_第4张图片
试了2.9.X、2.11.0都不行。

你可能感兴趣的:(spring,boot,spring)