title: Spring Boot/Jersey Component Scan Issue
body: <p>I'm using Spring Boot and Jersey for a small app, and I need to add @ComponentScan to scan a third-party library for some services. The problem is, whenever I add the @ComponentScan annotation, it seems that the Spring MVC DispatcherServlet takes over, and I can no longer hit my Jersey endpoints (it doesn't look like the JerseyServlet is even loaded when I add the annotation). How do I get component scan to work alongside my Jersey endpoints?</p>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>    buildscript {
      ext {
          springBootVersion = '1.5.1.RELEASE'
      }
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
      }
    }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'org.springframework.boot'
  
  jar {
      baseName = 'demo'
      version = '0.0.1-SNAPSHOT'
  }
  
  sourceCompatibility = 1.8
  
  repositories {
      mavenCentral()
  }
  
  
  dependencies {
      compile('org.springframework.boot:spring-boot-starter-jersey')
      compile('org.springframework.boot:spring-boot-starter-web')
      testCompile('org.springframework.boot:spring-boot-starter-test')
  }
  </code></pre>
  
  <p><strong>Application</strong></p>
  
  <pre><code>@SpringBootApplication
  @ComponentScan(basePackages = {"com.abc"})
  public class DemoApplication {
      public static void main(String[] args) {
          SpringApplication.run(DemoApplication.class, args);
      }
  }
  </code></pre>
  
  <p><strong>Config</strong></p>
  
  <pre><code>@Component
  @Configuration
  public class JerseyConfig extends ResourceConfig {
      @PostConstruct
      public void init() {
          packages("com.demo.rest.endpoint");
  
          register(new LoggingFeature(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), Level.INFO, LoggingFeature.DEFAULT_VERBOSITY, null));
      }
  }
  </code></pre>
  
  <p><strong>Endpoint</strong></p>
  
  <pre><code>@Component
  @Path("/test")
  public class TestEndpoint {
      @GET
      public String test() {
          return "Testing Jersey Endpoint";
      }
  }
  </code></pre>