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

相关推荐
武子康1 天前
大数据-263 实时数仓-Canal 增量订阅与消费原理:MySQL Binlog 数据同步实践
大数据·hadoop·后端
云烟成雨TD1 天前
Spring AI Alibaba 1.x 系列【5】ReactAgent 构建器深度源码解析
java·人工智能·spring
最初的↘那颗心1 天前
Agent 实战:构建第一个 Agent 与记忆系统设计
java·大模型·agent·spring ai·记忆系统
程序猿_极客1 天前
SpringBoot 三大参数注解详解:@RequestParam @RequestBody @PathVariable 区别及常用开发注解
java·spring boot·后端·面试八股文·springboot注释
小胖java1 天前
校园通衢公告枢纽系统
java·spring boot
Crazy________1 天前
docker4.8
java·开发语言·eureka
T__TIII1 天前
milvus 数据备份和还原
后端
cch89181 天前
Laravel 2.x:早期框架的奠基之路
java·开发语言
用户962377954481 天前
代码审计 | Filter —— Tomcat 内存马从零到注入
后端
snakeshe10101 天前
从装饰器到动态代理:彻底理解 Java AOP 的底层原理与实战应用
后端