Java SpringSwigger2:如何设置HTTPS协议?

Java SpringSwigger2:如何设置HTTPS协议?,java,spring,mongodb,swagger,Java,Spring,Mongodb,Swagger,当我在swagger中执行spring应用程序时,默认协议是http,我希望以https执行它,因为应用程序在https中运行。我如何配置它 这是我的代码: @Configuration @EnableSwagger2 public class SwaggerConfig{ @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .apiI

当我在swagger中执行spring应用程序时,默认协议是http,我希望以https执行它,因为应用程序在https中运行。我如何配置它

这是我的代码:

@Configuration
@EnableSwagger2
public class SwaggerConfig{
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(metaData())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.adp.mnc.metadata.controller"))
                .paths(PathSelectors.any())
                .build();

    }

您可以使用
.protocols(set.newHashSet(“http”,“https”))

我不能使用。protocols…无法解析“ApiSelectorBuilder”中的方法“protocols”