报错如下:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-11-21 14:20:40.012 ERROR 2968 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.13.jar:5.3.13]
最后找到了报错的原因:
springboot 2.6.0 与 2.9.2版本的swagger2不兼容,将springboot版本换成2.4后就兼容了。