SpringBoot 2.3 升级到 SpringBoot 2.7 爬坑-- Swagger 3
SpringBoot 2.3 升级到 SpringBoot 2.7 爬坑-- Swagger 报错 需要升级 到 3
Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
<!-- swagger 2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- swagger 2 -->
<!-- 引入swagger3包 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
SwaggerConfig
@Configuration
@EnableSwagger2
@Profile({"dev","test"}) //只有开发、测试环境,支持 swagger
public class SwaggerConfig {}
@Configuration
@EnableOpenApi
public class SwaggerConfig {}
本文来自博客园,作者:VipSoft 转载请注明原文链接:https://www.cnblogs.com/vipsoft/p/18486612