title: Do Spring @Component classes have to be public?
body: <p>I'd like to expose a component's interface as an interface and the implementing class would be package protected (and maybe in some other package):</p>
  
  <pre><code>package baz.iface
  
  interface Foo {
      void bar();
  }  
  
  
  package baz.whatever
  
  @Component
  class SpringyFoo implements baz.iface.Foo {
      public void bar() { frobnicate(); }
  }
  </code></pre>
  
  <p>Assuming <code>baz.whatever</code> is in the <code>component-scan</code>, will Spring be able to autowire a <code>baz.iface.Foo</code> somewhere else?</p>
  
  <pre><code>class FooClient {
      @Autowired
      private baz.iface.Foo;
  }
  </code></pre>