a. 问题描述:Failed to start bean ‘documentationPluginsBootstrapper'
b. 问题原因:
使用spring-boot-starter-parent:2.6.x与springfox-boot-starter:3.0.0生成接口文档过程,出现容器刷新失败,应用无法启动问题,显示Failed to start bean 'documentationPluginsBootstrapper',报出空指针异常!原因在于,spring boot已经改用PathPatternParser进行路径匹配解析,而springfox-boot-starter依然使用旧的AntPathMatcher,最终导致documentationPluginsBootstrapperbean创建失败。
c. 解决方法:
在配置application.properties中将路径匹配策略设置修改即可!
注意: 如果你还使用了
spring-boot-starter-actuator,以下设置将不能生效,具体不知道什么鬼原因,费了好大劲,依赖一个一个测出来的!
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
