when integrate swagger with mvc and use java-based configuration like

```
@Configuration
@EnableSwagger2
@PropertySource("classpath:application.properties")
public class SwaggerConfig extends WebMvcConfigurerAdapter {
    .
    .
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
    }
}

```

and use url `http://localhost:8080/admin-api/admin/swagger-ui.html` it give 404.
when i remove `addResourceHandlers` from `SwaggerConfig` configuration class and configure through xml like

```
<mvc:resources mapping="swagger-ui.html" location="classpath:/META-INF/resources/" />
<mvc:resources mapping="/webjars/**" location="classpath:/META-INF/resources/webjars/" />

```

with the same url `http://localhost:8080/admin-api/admin/swagger-ui.html` it run without problems. how can i use java-based configuration?