From b599bfe5ac3e68222fca34d8e0e9c54e49476b0f Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 19 Jul 2022 15:13:15 +0100 Subject: [PATCH] Temporarily work around deprecations in Spring Batch See gh-31623 --- .../boot/autoconfigure/batch/BasicBatchConfigurer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java index dac961ecc2..bf0701d8b3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java @@ -22,7 +22,7 @@ import org.springframework.batch.core.configuration.annotation.BatchConfigurer; import org.springframework.batch.core.explore.JobExplorer; import org.springframework.batch.core.explore.support.JobExplorerFactoryBean; import org.springframework.batch.core.launch.JobLauncher; -import org.springframework.batch.core.launch.support.SimpleJobLauncher; +import org.springframework.batch.core.launch.support.TaskExecutorJobLauncher; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean; import org.springframework.beans.factory.InitializingBean; @@ -117,8 +117,9 @@ public class BasicBatchConfigurer implements BatchConfigurer, InitializingBean { return factory.getObject(); } + @SuppressWarnings({ "deprecation", "removal" }) protected JobLauncher createJobLauncher() throws Exception { - SimpleJobLauncher jobLauncher = new SimpleJobLauncher(); + TaskExecutorJobLauncher jobLauncher = new TaskExecutorJobLauncher(); jobLauncher.setJobRepository(getJobRepository()); jobLauncher.afterPropertiesSet(); return jobLauncher;