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 区间的都可以。

相关推荐
CaffeinePro2 分钟前
FastAPI响应处理:返回值、状态码、响应头与异常标准化与案例解析
后端
小宇宙Zz11 分钟前
Maven依赖冲突
java·服务器·maven
swordbob14 分钟前
NIO的channel中什么是 fd(File Descriptor,文件描述符)
java·开发语言·nio
HuanYu18 分钟前
PageHelper分页的原理
后端
于先生吖21 分钟前
SpringBoot对接大模型开发AI命理测算系统:八字排盘与AI解析接口源码全解
人工智能·spring boot·后端
咖啡八杯32 分钟前
GoF设计模式——享元模式
java·spring·设计模式·享元模式
十五喵源码网39 分钟前
基于springboot2+vue2的租房管理系统
java·毕业设计·springboot·论文笔记
摇滚侠40 分钟前
IDEA 创建 Java 项目 手动整合 SSM 框架
java·ide·intellij-idea
源分享40 分钟前
Java线程同步的多种实现方法(非常详细)
java·开发语言·jvm
Flittly1 小时前
【AgentScope Java新手村系列】(10)实战-多Agent天气助手
java·spring boot·spring