Spring: How to inject a bean from another project
<p>I have two packages com.a.b.c and com.x.y.z. In com.a.b.c, I've defined a component like this:</p>

<pre><code>@Named
public class MyClass
{
    @Inject
    public MyClass()
    {
    }
}
</code></pre>

<p>In com.x.y.z, I have a class where I want to inject MyClassA like this:</p>

<pre><code>public class MyOtherClass
{
     @Inject
     private MyClass myClass;
}
</code></pre>

<p>What configuration changes do I need to make so that I can inject MyClass into MyOtherClass? Right now I get the build error </p>

<blockquote>
  <p>org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.a.b.c.MyClass] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency</p>
</blockquote>

<p>Thanks in advance.</p>