title: Spring Batch (modular=true) creates job config beans twice
body: <pre><code>@Configuration
  @EnableBatchProcessing(modular=true)
  public class ModularJobConfiguration {
  
      @Bean
      public ApplicationContextFactory job() {
          return new GenericApplicationContextFactory(FlatfileToDbJobConfiguration.class);
      }
  
      @Bean
      public ApplicationContextFactory anotherJob() {
          return new GenericApplicationContextFactory(FlatfileToDbJobAnotherConfiguration.class);
      }
  
  }
  </code></pre>
  
  <p>For example show only one config, another like this.</p>
  
  <pre><code>@Configuration
  public class FlatfileToDbJobConfiguration {
  
          @Autowired
          private JobBuilderFactory jobBuilders;
  
          @Autowired
          private StepBuilderFactory stepBuilders;
  
          @Bean
          public Job flatfileToDbJob(){
              return jobBuilders.get("flatfileToDbJob")
                      .listener(protocolListener())
                      .start(step())
                      .build();
          }
  
          @Bean
          public Step step(){
              return stepBuilders.get("step")
                      .&lt;Partner,Partner&gt;chunk(1)
                      .reader(reader())
                      .processor(processor())
                      .writer(writer())
                      .build();
          }
  
          // ...
          // rest part of code
          // ...
  }
  </code></pre>
  
  <p>All works fine, but all beans methods in config files call twice. I think, first in common context and second in individual. Is it normal? I can't use post construct, because it will call twice. How to have modular=true and only one bean initialization? Thanks!</p>