title: No Scope registered for scope name 'job' running a Spring Batch job with Annotation Config only
body: <p>I have to create batch jobs that need to create some configuration beans depending in the job parameters, So I can't instantiate them in the start of the application.</p>
  
  <p>I tried to follow some of the examples I found but none worked. Does anyone know how to fix this?</p>
  
  <pre><code>@SpringBootApplication
  @EnableConfigurationProperties
  @EnableBatchProcessing
  public class Application {
  
      public static void main(String[] args) {
      SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>The Job configuration:</p>
  
  <pre><code>@Configuration
  @Slf4j
  public class JobConfiguration {
      @Autowired
      private JobBuilderFactory jobs;
  
      @Autowired
      private StepBuilderFactory steps;
  
      /***
       * This job will create/update the resources in AWS accordingly with the
       * configuration provided.
       * 
       * @return the job
       */
      @Bean
      @Qualifier("NetworkJob")
      @Primary
      public Job createJob() {
      return jobs.get("Start Job").start(dummyTasklet()).build();
      }
  
      /***
       * Create a step to verify if a service role exists or to create it if not.
       * 
       * @return the step
       */
      @Bean
      @JobScope
      public Step dummyTasklet() {
      return steps.get("Dummy").tasklet((contribution, chunkContext) -&gt; {
          log.info("And I run ... ");
          return RepeatStatus.FINISHED;
      }).build();
      }
  
  }
  </code></pre>
  
  <p>And some JobScope beans:</p>
  
  <pre><code>@Configuration
  @Slf4j
  public class GitConfiguration {
      @Bean
      @Qualifier("GITPath")
      @JobScope
      public String getGitTemporaryPath() {
      return "/tmp/path";
      }
  
      @JobScope
      @Bean
      public Git getCustomerGitRepository(@Value("#{jobParameters[customerRepository]}") String customerRepository,
          @Value("#{jobParameters[customerBranch]}") String customerBranch,
          @Value("#{jobParameters[vaultSecretPath]}") String vaultSecretPath,
          @Value("#{jobParameters[id]}") String id) {
  
      return Git.cloneRepository().setURI(customerRepository)
          .setDirectory(new File(getGitTemporaryPath() + id)).setBranch(customerBranch)
          .setCredentialsProvider(credentialsProvider).call();
      }
  
      @Bean
      @JobScope
      public PropertySourcesPlaceholderConfigurer properties(Git repository) {
         PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
         val path = repository.getRepository().getWorkTree().getAbsolutePath()
          + "file.yml";
      propertySourcesPlaceholderConfigurer.setLocation(new ClassPathResource(path));
         return propertySourcesPlaceholderConfigurer;
      }
  }
  </code></pre>