title: Spring Batch with modular=true doesn't work for multiple jobs
body: <p>I'm trying to configure two jobs with <code>@EnableBatchProcessing(modular = true)</code>. This is to prevent naming clash as far as I understand.</p>
  
  <p>Here's my job configuration:</p>
  
  <pre><code>@Configuration
  public class Dummy1 {
  
      @Autowired
      JobBuilderFactory jobBuilderFactory;
      @Autowired
      StepBuilderFactory stepBuilderFactory;
  
      @Bean
      public Step step() {
          // &lt; build step. Omitted for code clarity &gt; 
      }
  
      @Bean
      public Job getJob() {
          return jobBuilderFactory.get("dummy-job-1")
                  .start(step())
                  .build();
      }
  }
  </code></pre>
  
  <p>I have a similar class named <code>Dummy2</code>.</p>
  
  <p>I also defined the following configuration:</p>
  
  <pre><code>@Configuration
  @EnableAutoConfiguration
  @EnableBatchProcessing(modular = true)
  public class BatchConfig {
  
      @Bean
      public ApplicationContextFactory getDummy1() {
          return new GenericApplicationContextFactory(Dummy1.class);
      }
  
      @Bean
      public ApplicationContextFactory getDummy2() {
          return new GenericApplicationContextFactory(Dummy2.class);
      }
  }
  </code></pre>
  
  <p>When running the application I'm getting:</p>
  
  <blockquote>
    <p>The bean 'step', defined in class path resource
    [~PATH~/Dumm2.class], could
    not be registered. A bean with that name has already been defined in
    class path resource
    [~PATH~/Dumm1.class] and
    overriding is disabled.</p>
  </blockquote>
  
  <p>But I thought this is the all point of modular=true. That is, to handle names clashes. </p>
  
  <p>On the other hand, if I'm enabling bean overriding I'm left with the second job overriding the first one. </p>
  
  <p>i.e. <code>@Autowired List&lt;Job&gt;</code> has only one job (from <code>Dummy2.class</code>)</p>
  
  <p>How to configure these jobs correctly?</p>