springboot 集成Swagger2报错 Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException

原因:因为Springfox使用的路径匹配是基于AntPathMatcher的,
而Spring Boot 2.6.X使用的是PathPatternMatcher。

方法1:

修改application.yml 
spring: 
	mvc: 
		pathmatch: 
			matching-strategy: ANT_PATH_MATCHER

方法2:

swagger2版本为2.9.2,springboot版本为2.6.2时
Springboot版本过高,降为2.5.6
Logo

鸿蒙生态一站式服务平台。

更多推荐