SpringBoot集成 Swagger 后,启动报 org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
错误图示:
原因:是因为 Swagger 和 SpringBoot 的版本兼容
解决办法:修改 SpringBoot 版本即可:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.9</version> <relativePath/> <!-- lookup parent from repository --> </parent>