title: SpringFox not finding jax-rs endpoints
body: <p>After solving <a href="https://stackoverflow.com/questions/32833737/using-springfox-to-document-jax-rs-services-in-a-spring-app">Using Springfox to document jax-rs services in a Spring app</a>, I now find that SpringFox's JSON reply doesn't show any APIs:</p>
  
  <pre><code>{
    "swagger": "2.0",
    "info": {
      "description": "Some description",
      "version": "1.0",
      "title": "My awesome API",
      "contact": {
        "name": "my-email@domain.org"
      },
      "license": {}
    },
    "host": "localhost:9090",
    "basePath": "/myapp"
  }
  </code></pre>
  
  <p>Here's springfox-servlet.xml:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"&gt;
  
      &lt;bean class="com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON" /&gt;
      &lt;bean class="com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider" /&gt;
      &lt;bean class="com.wordnik.swagger.jaxrs.listing.ResourceListingProvider" /&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>This is in a properties file:</p>
  
  <pre><code>swagger.resourcePackage=org.myapp
  </code></pre>
  
  <p>Swagger is configured to find the implementation classes using the reflective jax-rs scanner:</p>
  
  <pre><code>@Component
  public class SwaggerConfiguration {
  
      @Value("${swagger.resourcePackage}")
      private String resourcePackage;
  
      @PostConstruct
      public void init() {
          ReflectiveJaxrsScanner scanner = new ReflectiveJaxrsScanner();
          scanner.setResourcePackage(resourcePackage);
          ScannerFactory.setScanner(scanner);
  
          ClassReaders.setReader(new DefaultJaxrsApiReader());
  
          SwaggerConfig config = ConfigFactory.config();
          config.setApiVersion(apiVersion);
          config.setBasePath(basePath);
      }
  
      public String getResourcePackage() {
          return resourcePackage;
      }
  
      public void setResourcePackage(String resourcePackage) {
          this.resourcePackage = resourcePackage;
      }
  }
  </code></pre>
  
  <p>Here's the documentation configuration:</p>
  
  <pre><code>@Configuration
  @EnableSwagger2
  public class ApiDocumentationConfiguration {
      @Bean
      public Docket documentation() {
          System.out.println("=========================================== Initializing Swagger");
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .apis(RequestHandlerSelectors.any())
                  .paths(PathSelectors.any())
                  .build()
                  .pathMapping("/")
                  .apiInfo(metadata());
      }
  
      @Bean
      public UiConfiguration uiConfig() {
          return UiConfiguration.DEFAULT;
      }
  
      private ApiInfo metadata() {
          return new ApiInfoBuilder()
                  .title("My awesome API")
                  .description("Some description")
                  .version("1.0")
                  .contact("my-email@domain.org")
                  .build();
      }
  }
  </code></pre>
  
  <p>And here's a sample class with the api annotations:</p>
  
  <pre><code>@Api(value = "activity")
  @Service
  @Path("api/activity")
  @Produces({ MediaType.APPLICATION_JSON })
  public class ActivityService {
  
      @Autowired
      private CommandExecutor commandExecutor;
      @Autowired
      private FetchActivityCommand fetchActivityCommand;
  
      @ApiOperation(value = "Fetch logged-in user's activity", httpMethod = "GET", response = Response.class)
      @GET
      @Path("/mine")
      @Consumes(MediaType.TEXT_PLAIN)
      @Produces(MediaType.APPLICATION_JSON)
      @Authorization(rejectionMessage = Properties.Authorization.NOT_LOGGED_IN_MESSAGE_PREFIX + "view your activities.")
      public List&lt;Activity&gt; listMyActivities(@Context HttpServletResponse response, @Context HttpServletRequest request) throws IOException {
          return buildActivityList(response, (UUID) request.getSession().getAttribute(Properties.Session.SESSION_KEY_USER_GUID));
      }
      ...
  }
  </code></pre>
  
  <p>Why isn't it exposing the API? Would using the wordnik swagger library solve this, or improve the solution?</p>