问题:
Springboot 集成 Swagger 报错Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
解决办法:
Swagger2版本是2.9.2、springboot 版本是2.6.2,因为springboot版本太高,缺少swagger运行所需要的环境,回退到之前的版本,我这里回退到 2.5.6,记得把spring-boot-text也改成版本一样的,要不报错Cannot resolve org.springframework:spring-context:5.3.12
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.5.6</version>
</dependency>