SpringBoot 3.5.10引入springdoc-openapi-starter-webmvc-ui版本

SpringBoot 3.5.10 引入openapi 3.0.1包,包版本过高报错;

pom.xml

xml 复制代码
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>3.0.1</version>
            <scope>compile</scope>
        </dependency>

版本过高 编译即报错 编译失败:

复制代码
***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'conventionErrorViewResolver', defined in class path resource [org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Disconnected from the target VM, address: '127.0.0.1:60346', transport: 'socket'

SpringBoot 3.5.10 引入openapi 2.6.0包,openapi包版本过低报错;

xml 复制代码
 <!-- SpringDoc OpenAPI(接口文档,替代Swagger2) -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
			<version>2.6.0</version>
            <scope>compile</scope>
        </dependency>

版本过低:

服务器内部错误:Handler dispatch failed: java.lang.NoSuchMethodError: 'void o

实践结论:

jdk17 ,springboot3.5.10 ,使用openapi 版本在 2.7.0 - 2.8.15 区间的都可以。

相关推荐
我是咸鱼不闲呀2 小时前
力扣Hot100系列15(Java)——[二叉树]总结(有效的括号,最小栈,字符串解码,每日温度,柱状图中最大的矩形)
java·算法·leetcode
沉默-_-2 小时前
MyBatis 学习笔记
java·开发语言·tomcat
未来龙皇小蓝2 小时前
Spring内置常见线程池配置及相关概念
java·后端·spring·系统架构
Elias不吃糖2 小时前
Java 常用数据结构:API + 实现类型 + 核心原理 + 例子 + 选型与性能(完整版)
java·数据结构·性能·实现类
会游泳的石头2 小时前
构建企业级知识库智能问答系统:基于 Java 与 Spring Boot 的轻量实现
java·开发语言·spring boot·ai
澄风2 小时前
Redis ZSet+Lua脚本+SpringBoot实战:滑动窗口限流方案从原理到落地
spring boot·redis·lua
新缸中之脑2 小时前
Google:Rust实战评估
开发语言·后端·rust
是梦终空2 小时前
计算机毕业设计263—基于Springboot+Vue的影视推荐和评分系统(源代码+数据库)
spring boot·vue·毕业设计·课程设计·协同过滤算法·影评系统·影视推荐系统
说给风听.2 小时前
Maven 配置实战:从环境搭建到 Idea 关联(超详细)
java·maven·intellij-idea