Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
使用springboot2.6.0后,配置swagger,不论是2.9.2还是3.0.0都报错
解决方法:配置文件中加入 application.yml
spring: mvc: pathmatch: matching-strategy: ant_path_matcher
还有另一种情况:
没有获取到你的swaggerConfig配置类,这种情况在启动类上加个注解就行
二选其一便可:
@ComponentScan(value = "com.buba.config")
@Import(SwaggerConfig.class)
@SpringBootApplication @ComponentScan(value = "com.buba.config") //@Import(SwaggerConfig.class) public class UserApplication { public static void main(String[] args) { SpringApplication.run(UserApplication.class,args); } }