spring-boot - Spring Boot 应用程序中不匹配的托管依赖项导致类路径版本问题
问题描述
我有一个 Spring Boot 应用程序,版本 2.1.7,它引入了 spring-boot-webmvc-5.1.9.RELEASE。maven构建一切都很好。但是,当我尝试启动 spring boot 应用程序时,它会抱怨说:
Correct the classpath of your application so that it contains a single, compatible version of
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration
我的依赖树如下所示:
[INFO] +- org.springframework.boot:spring-boot:jar:2.1.7.RELEASE:compile
[INFO] | \- org.springframework:spring-context:jar:5.1.9.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.1.9.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:5.1.9.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.1.9.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.1.7.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.1.7.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.1.7.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.1.7.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.11.2:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.11.2:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.26:compile
[INFO] | | \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.1.7.RELEASE:test
解决方案
推荐阅读
- reactjs - React .Net Core 不允许渲染根组件
- session - 无论 setMaxIdleTimeout 的值如何,Java WebSocket 会话都会超时
- javascript - 将参数从 Liquid 传递给 JS 函数
- c# - 图像编码为 ccitt 的 iOS pdf
- spring - SpringBoot 2.0.1 中未提供执行器 /refresh
- django - 为什么我不能在 Django 的同一迁移中为组分配新权限
- machine-learning - ALS(交替最小二乘)算法在用户的多个排名中
- sql - 如何使用oracle sql获取多列中的第一个非零/非空值和最后一个零/非空值
- angular - Angular 项目中无法识别的功能
- nginx - 使用 ansible 启动 nginx 网络服务器:localhost:8080 没有响应