Migrate to Spring Batch 6.0 from 5.2

MSAL

Migrate applications built on Spring Batch 5.2 to the latest Spring Batch 6.0 release.

org.openrewrite.java.spring.batch.SpringBatch5To6Migration
mod run . --recipe=org.openrewrite.java.spring.batch.SpringBatch5To6Migration

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Migrate to Spring Batch 5.0 from 4.3
  2. Upgrade Gradle or Maven dependency versions org.springframework.batch:*:6.0.x
  3. Rename package name org.springframework.batch.item to org.springframework.batch.infrastructure.item
  4. Rename package name org.springframework.batch.poller to org.springframework.batch.infrastructure.poller
  5. Rename package name org.springframework.batch.repeat to org.springframework.batch.infrastructure.repeat
  6. Rename package name org.springframework.batch.support to org.springframework.batch.infrastructure.support
  7. Rename package name org.springframework.batch.core.explore to org.springframework.batch.core.repository.explore
  8. Change type org.springframework.batch.core.repository.dao.JdbcExecutionContextDao to org.springframework.batch.core.repository.dao.jdbc.JdbcExecutionContextDao
  9. Change type org.springframework.batch.core.repository.dao.JdbcJobExecutionDao to org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao
  10. Change type org.springframework.batch.core.repository.dao.JdbcJobInstanceDao to org.springframework.batch.core.repository.dao.jdbc.JdbcJobInstanceDao
  11. Change type org.springframework.batch.core.repository.dao.JdbcStepExecutionDao to org.springframework.batch.core.repository.dao.jdbc.JdbcStepExecutionDao
  12. Change type org.springframework.batch.core.repository.dao.MongoExecutionContextDao to org.springframework.batch.core.repository.dao.mongo.MongoExecutionContextDao
  13. Change type org.springframework.batch.core.repository.dao.MongoJobExecutionDao to org.springframework.batch.core.repository.dao.mongo.MongoJobExecutionDao
  14. Change type org.springframework.batch.core.repository.dao.MongoJobInstanceDao to org.springframework.batch.core.repository.dao.mongo.MongoJobInstanceDao
  15. Change type org.springframework.batch.core.repository.dao.MongoStepExecutionDao to org.springframework.batch.core.repository.dao.mongo.MongoStepExecutionDao
  16. Change type org.springframework.batch.core.repository.dao.MongoSequenceIncrementer to org.springframework.batch.core.repository.dao.mongo.MongoSequenceIncrementer
  17. Change type org.springframework.batch.core.partition.support.Partitioner to org.springframework.batch.core.partition.Partitioner
  18. Change type org.springframework.batch.core.partition.support.PartitionNameProvider to org.springframework.batch.core.partition.PartitionNameProvider
  19. Change type org.springframework.batch.core.partition.support.PartitionStep to org.springframework.batch.core.partition.PartitionStep
  20. Change type org.springframework.batch.core.partition.support.StepExecutionAggregator to org.springframework.batch.core.partition.StepExecutionAggregator
  21. Change type org.springframework.batch.core.ChunkListener to org.springframework.batch.core.listener.ChunkListener
  22. Change type org.springframework.batch.core.ItemProcessListener to org.springframework.batch.core.listener.ItemProcessListener
  23. Change type org.springframework.batch.core.ItemReadListener to org.springframework.batch.core.listener.ItemReadListener
  24. Change type org.springframework.batch.core.ItemWriteListener to org.springframework.batch.core.listener.ItemWriteListener
  25. Change type org.springframework.batch.core.JobExecutionListener to org.springframework.batch.core.listener.JobExecutionListener
  26. Change type org.springframework.batch.core.SkipListener to org.springframework.batch.core.listener.SkipListener
  27. Change type org.springframework.batch.core.StepExecutionListener to org.springframework.batch.core.listener.StepExecutionListener
  28. Change type org.springframework.batch.core.StepListener to org.springframework.batch.core.listener.StepListener
  29. Change type org.springframework.batch.core.Job to org.springframework.batch.core.job.Job
  30. Change type org.springframework.batch.core.JobExecution to org.springframework.batch.core.job.JobExecution
  31. Change type org.springframework.batch.core.JobExecutionException to org.springframework.batch.core.job.JobExecutionException
  32. Change type org.springframework.batch.core.JobInstance to org.springframework.batch.core.job.JobInstance
  33. Change type org.springframework.batch.core.JobInterruptedException to org.springframework.batch.core.job.JobInterruptedException
  34. Change type org.springframework.batch.core.JobKeyGenerator to org.springframework.batch.core.job.JobKeyGenerator
  35. Change type org.springframework.batch.core.DefaultJobKeyGenerator to org.springframework.batch.core.job.DefaultJobKeyGenerator
  36. Change type org.springframework.batch.core.StartLimitExceededException to org.springframework.batch.core.job.StartLimitExceededException
  37. Change type org.springframework.batch.core.UnexpectedJobExecutionException to org.springframework.batch.core.job.UnexpectedJobExecutionException
  38. Change type org.springframework.batch.core.CompositeJobParametersValidator to org.springframework.batch.core.job.parameters.CompositeJobParametersValidator
  39. Change type org.springframework.batch.core.DefaultJobParametersValidator to org.springframework.batch.core.job.parameters.DefaultJobParametersValidator
  40. Change type org.springframework.batch.core.JobParameter to org.springframework.batch.core.job.parameters.JobParameter
  41. Change type org.springframework.batch.core.JobParameters to org.springframework.batch.core.job.parameters.JobParameters
  42. Change type org.springframework.batch.core.JobParametersBuilder to org.springframework.batch.core.job.parameters.JobParametersBuilder
  43. Change type org.springframework.batch.core.JobParametersIncrementer to org.springframework.batch.core.job.parameters.JobParametersIncrementer
  44. Change type JobParametersInvalidException to InvalidJobParametersException
  45. Change type org.springframework.batch.core.JobParametersValidator to org.springframework.batch.core.job.parameters.JobParametersValidator
  46. Change type org.springframework.batch.core.launch.support.RunIdIncrementer to org.springframework.batch.core.job.parameters.RunIdIncrementer
  47. Change type org.springframework.batch.core.launch.support.DataFieldMaxValueJobParametersIncrementer to org.springframework.batch.core.job.parameters.DataFieldMaxValueJobParametersIncrementer
  48. Change type org.springframework.batch.core.Step to org.springframework.batch.core.step.Step
  49. Change type org.springframework.batch.core.StepContribution to org.springframework.batch.core.step.StepContribution
  50. Change type org.springframework.batch.core.StepExecution to org.springframework.batch.core.step.StepExecution
  51. Change type ChunkHandler to ChunkRequestHandler
  52. Change type JobRepositoryFactoryBean to JdbcJobRepositoryFactoryBean
  53. Change type JobExplorerFactoryBean to JdbcJobExplorerFactoryBean
  54. Change type org.springframework.batch.core.repository.JobExecutionAlreadyRunningException to org.springframework.batch.core.launch.JobExecutionAlreadyRunningException
  55. Change type org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException to org.springframework.batch.core.launch.JobInstanceAlreadyCompleteException
  56. Change type org.springframework.batch.core.repository.JobRestartException to org.springframework.batch.core.launch.JobRestartException
  57. Change method name org.springframework.batch.core.step.job.JobStep setJobLauncher(org.springframework.batch.core.launch.JobLauncher) to setJobOperator
  58. Change method name org.springframework.batch.core.step.builder.JobStepBuilder launcher(org.springframework.batch.core.launch.JobLauncher) to operator
  59. Change type JobLauncher to JobOperator
  60. Change method name org.springframework.batch.core.step.tasklet.SystemCommandTasklet setJobExplorer(org.springframework.batch.core.repository.explore.JobExplorer) to setJobRepository
  61. Change method name org.springframework.batch.core.partition.support.RemoteStepExecutionAggregator setJobExplorer(org.springframework.batch.core.repository.explore.JobExplorer) to setJobRepository
  62. Change type JobExplorer to JobRepository
  63. Migrate to the new chunk-oriented step model
  64. Change type JobRegistryBeanPostProcessor to JobRegistrySmartInitializingSingleton