StepBuilderFactory, JobBuilderFactory Inspection 'Incorrect autowiring in Spring bean components' options
Spring Boot 3.x ~ 사용 해결법 package com.sh.springbatch; import lombok.extern.slf4j.Slf4j; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.job.builder.JobBuilder; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.step.builder.StepBuilder; import org.springframework.batch.core.step.tasklet.Tasklet; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.transaction.PlatformTransactionManager; @Slf4j @Configuration public class MyJobConfig { @Bean public Job simpleJob1(JobRepository jobRepository, Step simpleStep1) { return new JobBuilder("simpleJob", jobRepository) .start(simpleStep1) .build(); } @Bean public Step simpleStep1(JobRepository jobRepository, Tasklet testTasklet, PlatformTransactionManager platformTransactionManager){ return new StepBuilder("simpleStep1", jobRepository) .tasklet(testTasklet, platformTransactionManager).build(); } @Bean public Tasklet testTasklet(){ return ((contribution, chunkContext) -> { log.info(">>>>> This is Step1"); return RepeatStatus.FINISHED; }); } }Spring boot : 3.x~ 이상부터는 @EnableProcessing을 사용하지 않는다고 합니다 .출처 : https://velog.io/@calaf/Spring-Batch-%EC%82%AC%EC%9A%A9%ED%95%B4%EB%B3%B4%EA%B8%B0-1.-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0#1-spring-batch