title: Can I make Eclipse recognise Spring beans across multiple XML files?
body: <p>My application loads Spring bean definitions from two XML files:</p>
  
  <pre><code>String[] beandefs = new String[] {
          "commonConfig.xml",
          "specificConfig.xml"
    };
    ApplicationContext context = new ClassPathXmlApplicationContext(
          beandefs);
  </code></pre>
  
  <p>This is because <code>commonConfig.xml</code> contains definitions that I want in all deployments. <code>specificConfig.xml</code> has definitions which I swap out for other implementations in a test deployments.</p>
  
  <p>This works fine, except that where a bean references another bean in the other file, Eclipse (STS) marks it with a warning.</p>
  
  <p>e.g. If <code>commonConfig.xml</code> contains:</p>
  
  <pre><code>  &lt;bean id="foo" class="com.example.Foo"&gt;
      &lt;property name="bar" ref="bar" /&gt;
    &lt;/bean&gt;
  </code></pre>
  
  <p>... and <code>specificConfig.xml</code> contains:</p>
  
  <pre><code>  &lt;bean id="bar" class="com.example.Bar"&gt;
         ...
    &lt;/bean&gt;
  </code></pre>
  
  <p>The application works fine, but Eclipse warns in <code>commonConfig.xml</code>:</p>
  
  <pre><code> Referenced bean 'bar' not found.
  </code></pre>
  
  <p>How can I tell Eclipse to look in both files?</p>