无法使用带有swagger 2的弹簧启动来启动微服务

时间:2018-04-10 07:17:23

标签: spring-boot swagger

我试图在春季启动时使用swagger 2,但我得到以下异常:

index.php

我的swagger配置类是:

org.springframework.beans.BeanInstantiationException: Failed to instantiate [springfox.documentation.swagger.web.SecurityConfiguration]: Factory method 'security' threw exception; nested exception is java.lang.NoSuchMethodError: springfox.documentation.swagger.web.SecurityConfiguration.

我在我的pom中添加了以下两个依赖项:

@Configuration
@EnableSwagger2
public class SwaggerConfig{
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build();
    }
}

0 个答案:

没有答案