Springboot 集成Swagger2 3.0.0 解决Failed to start bean 'documentationPluginsBootstrapper'

添加依赖

<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-boot-starter</artifactId>
  <version>3.0.0</version>
</dependency>

编写Swagger2配置类

@EnableWebMvc注解可以解决
Failed to start bean 'documentationPluginsBootstrapper'的问题

@Configuration
@EnableWebMvc
public class Swagger2Config {
}

测试

启动项目输入网址
Swagger2 2.x.x 版本网址为

http://localhost:8080/swagger-ui.html

Swagger2 3.0.0 之后的版本网址为

http://localhost:8080/swagger-ui/index.html

posted @ 2022-01-02 18:16  PP朱丶  阅读(485)  评论(0)    收藏  举报