WARN 404 --- [nio-8080-exec-1] o.s.web.servlet.PageNotFound : No mapping for GET /swagger-ui.html Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
给他继承 WebMvcConfigurationSupport
并重写 ddResourceHandlers方法
标签:web,8080,nio,PageNotFound,---,META,registry,addResourceLocations From: https://www.cnblogs.com/wh521/p/16789727.html
@Configuration
@EnableSwagger2
public class SwaggerConfig extends WebMvcConfigurationSupport {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("doc.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}