Upgrade dependencies to major versions for Spring Batch 5

* Upgrade to Jakarta EE 9
* Upgrade to Spring Framework 6
* Upgrade to Spring Integration 6
* Upgrade to Spring Data 3
* Upgrade to Spring AMQP 3
* Upgrade to Spring for Apache Kafka 3

LDIF support is still in progress waiting for the next
major version of Spring LDAP.

Closes #4027
Closes #3656
This commit is contained in:
Mahmoud Ben Hassine
2021-09-23 08:29:13 +02:00
parent 2a9904bae1
commit 5dc17b190e
197 changed files with 1295 additions and 1172 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,9 +18,9 @@ package org.springframework.batch.item.database;
import java.util.Iterator;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.Query;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStreamException;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@ import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
import org.springframework.util.Assert;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import java.util.List;
/**
@@ -36,13 +36,14 @@ import java.util.List;
* It is required that {@link #write(List)} is called inside a transaction.<br>
*
* The reader must be configured with an
* {@link javax.persistence.EntityManagerFactory} that is capable of
* {@link jakarta.persistence.EntityManagerFactory} that is capable of
* participating in Spring managed transactions.
*
* The writer is thread-safe after its properties are set (normal singleton
* behaviour), so it can be used to write in multiple concurrent transactions.
*
* @author Thomas Risberg
* @author Mahmoud Ben Hassine
*
*/
public class JpaItemWriter<T> implements ItemWriter<T>, InitializingBean {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,10 +21,10 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.EntityTransaction;
import jakarta.persistence.Query;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.database.orm.JpaQueryProvider;
@@ -65,7 +65,7 @@ import org.springframework.util.ClassUtils;
*
* <p>
* The reader must be configured with an
* {@link javax.persistence.EntityManagerFactory}. All entity access is
* {@link jakarta.persistence.EntityManagerFactory}. All entity access is
* performed within a new transaction, independent of any existing Spring
* managed transactions.
* </p>
@@ -81,6 +81,7 @@ import org.springframework.util.ClassUtils;
* @author Thomas Risberg
* @author Dave Syer
* @author Will Schipp
* @author Mahmoud Ben Hassine
* @since 2.0
*/
public class JpaPagingItemReader<T> extends AbstractPagingItemReader<T> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.item.database.builder;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStreamSupport;
@@ -145,7 +145,7 @@ public class JpaCursorItemReaderBuilder<T> {
* {@link #queryString}.
*
* @param entityManagerFactory {@link EntityManagerFactory} used to create
* {@link javax.persistence.EntityManager}
* {@link jakarta.persistence.EntityManager}
* @return this instance for method chaining
*/
public JpaCursorItemReaderBuilder<T> entityManagerFactory(EntityManagerFactory entityManagerFactory) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2020 the original author or authors.
* Copyright 2018-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.item.database.builder;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.springframework.batch.item.database.JpaItemWriter;
import org.springframework.util.Assert;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package org.springframework.batch.item.database.builder;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.springframework.batch.item.database.JpaPagingItemReader;
import org.springframework.batch.item.database.orm.JpaQueryProvider;
@@ -184,7 +184,7 @@ public class JpaPagingItemReaderBuilder<T> {
* {@link #queryString}.
*
* @param entityManagerFactory {@link EntityManagerFactory} used to create
* {@link javax.persistence.EntityManager}
* {@link jakarta.persistence.EntityManager}
* @return this instance for method chaining
*/
public JpaPagingItemReaderBuilder<T> entityManagerFactory(EntityManagerFactory entityManagerFactory) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.database.orm;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.Query;
import org.springframework.beans.factory.InitializingBean;
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.InitializingBean;
*
* @author Anatoly Polinsky
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
* @since 2.1
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.item.database.orm;
import javax.persistence.Query;
import jakarta.persistence.Query;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2008 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package org.springframework.batch.item.database.orm;
import javax.persistence.Query;
import jakarta.persistence.Query;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
@@ -29,6 +29,7 @@ import org.springframework.util.StringUtils;
* </p>
*
* @author Anatoly Polinsky
* @author Mahmoud Ben Hassine
*
* @param <E> entity returned by executing the query
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2008 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.database.orm;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.Query;
import org.springframework.batch.item.ItemReader;
@@ -27,6 +27,7 @@ import org.springframework.batch.item.ItemReader;
*
* @author Anatoly Polinsky
* @author Dave Syer
* @author Mahmoud Ben Hassine
* @since 2.1
*
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ import org.springframework.jms.core.JmsTemplate;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import javax.jms.Message;
import jakarta.jms.Message;
/**
* An {@link ItemReader} for JMS using a {@link JmsTemplate}. The template
@@ -37,6 +37,7 @@ import javax.jms.Message;
* singleton behavior).
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class JmsItemReader<T> implements ItemReader<T>, InitializingBean {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.jms;
import javax.jms.JMSException;
import javax.jms.Message;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import org.springframework.batch.item.UnexpectedInputException;
import org.springframework.retry.interceptor.MethodArgumentsKeyGenerator;
@@ -26,6 +26,7 @@ import org.springframework.retry.interceptor.MethodArgumentsKeyGenerator;
* A {@link MethodArgumentsKeyGenerator} for JMS
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class JmsMethodArgumentsKeyGenerator implements MethodArgumentsKeyGenerator {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.jms;
import javax.jms.JMSException;
import javax.jms.Message;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import org.springframework.batch.item.UnexpectedInputException;
import org.springframework.retry.interceptor.NewMethodArgumentsIdentifier;
@@ -27,6 +27,7 @@ import org.springframework.retry.interceptor.NewMethodArgumentsIdentifier;
* the arguments and checks its delivery status.
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class JmsNewMethodArgumentsIdentifier<T> implements NewMethodArgumentsIdentifier {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package org.springframework.batch.item.jms.builder;
import javax.jms.Message;
import jakarta.jms.Message;
import org.springframework.batch.item.jms.JmsItemReader;
import org.springframework.jms.core.JmsOperations;
@@ -26,6 +26,7 @@ import org.springframework.util.Assert;
* Creates a fully qualified JmsItemReader.
*
* @author Glenn Renfro
* @author Mahmoud Ben Hassine
*
* @since 4.0
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2010 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMailMessage;
import org.springframework.util.Assert;
import javax.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeMessage;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -54,6 +54,7 @@ import java.util.Map.Entry;
* </p>
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
* @since 2.1
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2019 the original author or authors.
* Copyright 2018-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package org.springframework.batch.item.validator;
import javax.validation.Validator;
import jakarta.validation.Validator;
import org.springframework.util.Assert;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@ package org.springframework.batch.jsr.item;
import java.io.Serializable;
import javax.batch.api.chunk.ItemReader;
import javax.batch.api.chunk.ItemWriter;
import jakarta.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemWriter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -37,6 +37,7 @@ import org.springframework.util.SerializationUtils;
* {@link ItemReader#checkpointInfo()} or {@link ItemWriter#checkpointInfo()} calls.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public abstract class CheckpointSupport extends ItemStreamSupport{

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.jsr.item;
import javax.batch.api.chunk.ItemProcessor;
import jakarta.batch.api.chunk.ItemProcessor;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.jsr.item;
import java.io.Serializable;
import javax.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemReader;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
@@ -28,6 +28,7 @@ import org.springframework.util.ClassUtils;
* to the corresponding method on the delegate.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class ItemReaderAdapter<T> extends CheckpointSupport implements org.springframework.batch.item.ItemReader<T> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.batch.jsr.item;
import java.io.Serializable;
import java.util.List;
import javax.batch.api.chunk.ItemWriter;
import jakarta.batch.api.chunk.ItemWriter;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
@@ -28,6 +28,7 @@ import org.springframework.util.ClassUtils;
* to the corresponding method on the delegate.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class ItemWriterAdapter<T> extends CheckpointSupport implements org.springframework.batch.item.ItemWriter<T> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
package org.springframework.batch.jsr.repeat;
import javax.batch.api.chunk.CheckpointAlgorithm;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.CheckpointAlgorithm;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.repeat.CompletionPolicy;
import org.springframework.batch.repeat.RepeatContext;
@@ -28,6 +28,7 @@ import org.springframework.util.Assert;
* of the framework.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @see CheckpointAlgorithm
* @see CompletionPolicy
*/