title: How to rewrite spring configuration from XML to Java
body: <p>I have Spring XML configuration file like this:</p>
  <pre><code>&lt;bean id=&quot;A&quot; class=&quot;a.b.c.d.ConfigurationA&quot; /&gt;
  &lt;bean class=&quot;a.b.c.d.ConfigurationB&quot; /&gt;
  &lt;bean id=&quot;C&quot; class=&quot;a.b.c.d.e.ConfigurationC&quot; depends-on=&quot;objectFromConfigurationB&quot; /&gt;
  </code></pre>
  <p>Each configuration file import other config classes. Example:</p>
  <pre><code>@Configuration
  @Import({ConfigA.class, ConfigB.class})
  class ConfigurationA {
  
      @Bean 
      public ABC abc() {
          return new ABC();
      }
      ...
      ...
      ..
  }
  </code></pre>
  <p>I would like to rewrite this XML config into Java keeping all relations (<code>depends-on</code>). How can I do it?</p>
  <p>I tried with:</p>
  <ul>
  <li>ComponentScan</li>
  <li>Import</li>
  </ul>
  <p>always the same: beans from inner configuration files are not loaded into spring context. I caught <code>No bean 'A' available</code> error during startup.</p>
  <p>How to create <code>depends-on</code> relation during import configuration bundle?</p>