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

相关推荐
敖正炀10 小时前
BlockingQueue 与生产者-消费者模式:并发数据传递的源码内核
java
她的男孩10 小时前
Maven 多模块项目如何避免越写越乱?Forge Admin 的模块边界实践
后端
敖正炀10 小时前
Stream API 惰性求值与内部迭代
java
日月云棠10 小时前
4 高级配置:容错策略、降级保护与流量控制
java·后端
人道领域10 小时前
Java基础热门八股总结:八种基本数据类型 + 装箱拆箱 + 缓存机制,(90%的Java新手都搞不清的装箱拆箱问题)
java·开发语言·python
jameslogo10 小时前
如何用RocketMQTemplate发送事务消息
java·spring boot·rocketmq
菜鸟小九10 小时前
JUC补充(ThreadLocal、completableFuture)
java·开发语言
Seven9710 小时前
两小时入门Sentinel
java
tongluowan00711 小时前
Java中atomic底层原理 - ABA 问题与解决方案
java·juc·atomic
JuiceFS11 小时前
降低数据存储成本:JuiceFS v1.4 分层存储设计解析
运维·后端