title: How to integrate springfox-swagger2 with jersey in springboot
body: <p>I am using springboot with jersey as restful API. Now I want to integrate swagger2 into my project but it doesn't work. When I run my application and access <a href="http://localhost:8080/swagger-ui.html" rel="nofollow noreferrer">http://localhost:8080/swagger-ui.html</a>. I got the swagger web page but no api is showing(see below image). It seems that swagger didn't find my api classes.</p>
  
  <p><a href="https://i.stack.imgur.com/xq591.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xq591.png" alt="enter image description here"></a></p>
  
  <p>Below is the dependencies I added.</p>
  
  <pre><code>compile "io.springfox:springfox-swagger2:2.5.0"
  compile 'io.springfox:springfox-swagger-ui:2.5.0'
  </code></pre>
  
  <p>Below is my application class:</p>
  
  <pre><code>@SpringBootApplication
  @EnableSwagger2
  @EnableAutoConfiguration
  @Configuration
  @ComponentScan(value = "com.ticket.api")
  public class Application {
  
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  
  
      @Bean
      public Docket documentation() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .apis(RequestHandlerSelectors.basePackage("com.lenovo.ticket.api"))
                  .paths(PathSelectors.any())
  
                  .build().pathMapping("/")
                  .useDefaultResponseMessages(false);
      }
  
      @Bean
      UiConfiguration uiConfig() {
          return UiConfiguration.DEFAULT;
      }
  
  }
  </code></pre>
  
  <p>Below is my jersey config class:</p>
  
  <pre><code>@Configuration
  @ApplicationPath("/ticket")
  public class JerseyConfig extends ResourceConfig  {
  
      public JerseyConfig(){
          register(Helloworld.class);
      }
  
  }
  </code></pre>