Migrate to Spring Batch 5.0 from 4.3
MSALMigrate applications built on Spring Batch 4.3 to the latest Spring Batch 5.0 release.
org. openrewrite. java. spring. batch. SpringBatch4To5Migrationmod run . --recipe= org. openrewrite. java. spring. batch. SpringBatch4To5MigrationInstall 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.
- Upgrade Gradle or Maven dependency versions
org.springframework.batch:*:5.0.x - Transform classes that extend
*ListenerSupportto implement the*Listenerinterfaces instead - Migrate
JobBuilderFactorytoJobBuilder - Migrate
StepBuilderFactorytoStepBuilder - Add
PlatformTransactionManagertotasklet()andchunk()calls - Migrate
ItemWriter - Remove
DefaultBatchConfigurer - Change the type of
skipCountparameter inSkipPolicyfrominttolong - Change type
org.springframework.batch.core.metrics.BatchMetricstoorg.springframework.batch.core.observability.BatchMetrics - Change type
org.springframework.batch.core.step.item.Chunktoorg.springframework.batch.item.Chunk - Change type
org.springframework.batch.core.configuration.annotation.ScopeConfigurationtoorg.springframework.batch.core.configuration.support.ScopeConfiguration - Convert receive type in some invocation of StepExecution.xx()
- Migrate
DatetoLocalDateTimefor Spring Batch timestamp methods - Migrate
JobParameter.toString()toJobParameter.getValue().toString() - Add class argument to
JobParameters - Migrate method when it annotated by Spring Batch API