title: How to configure component-scan by annotation only in Spring?
body: <p>I'm running a war file on a tomcat webserver environment.</p>
  
  <p>I have an annotation based config for <code>@Beans</code>, and a xml config for webservices:</p>
  
  <pre><code>@Configuration
  //@ComponentScan(basePackageClasses = ...)
  public class AppConfig {
      //beans @Bean
  }
  </code></pre>
  
  <p>applicationContext.xml:</p>
  
  <pre><code>&lt;beans&gt;
      &lt;context:component-scan base-package="..."/&gt;
      &lt;jaxws:endpoint ... /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Problem: I would like to define <code>@ComponentScan</code> by annotation only to have typesafety. But if I do so, the scanning is not performed. In contrast, when I use <code>&lt;context:component-scan..</code> everything works fine.</p>
  
  <p>Is <code>Spring</code> component scanning within a webserver tied to configuration with xml for the package scanning?</p>