Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot 3 Upgrade #817

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ API changes will follow SEMVER and loosly the Spring Framework releases.
| 5.0.x | >= 2.0 && < 2.1 | >= 5.0 && < 5.1 | Kay-SR1 |
| 5.1.x | == 2.1 | >= 5.1 | Lovelace-SR1 |
| 5.2.x | >= 2.2 | >= 5.2 | Moore-RELEASE, Nuemann-RELASE |

| 6.0.x | >= 3.0 | >= 6.0 | 2023.0.5 |

`spring-data-dynamodb` depends directly on `spring-data` as also `spring-context`, `spring-data` and `spring-tx`.

Expand Down
166 changes: 81 additions & 85 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.boostchicken</groupId>
<artifactId>spring-data-dynamodb</artifactId>
<version>5.2.6-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<name>Spring Data DynamoDB</name>
<inceptionYear>2018</inceptionYear>

Expand All @@ -37,23 +37,22 @@
</licenses>

<properties>
<spring.version>5.3.15</spring.version>
<spring-data.version>2.4.15</spring-data.version>
<spring.version>6.0.13</spring.version>
<spring-data.version>3.1.5</spring-data.version>

<hibernate-validator.version>6.2.2.Final</hibernate-validator.version>
<aws-java-sdk.version>1.12.150</aws-java-sdk.version>
<aws-java-sdk.version>1.12.583</aws-java-sdk.version>
<junit.version>4.13.2</junit.version>
<mockito.version>2.23.0</mockito.version>
<cdi.version>2.0</cdi.version>
<mockito.version>5.7.0</mockito.version>
<cdi.version>4.0.1</cdi.version>
<slf4j-test.version>1.2.0</slf4j-test.version>
<sqlite4java.version>1.0.392</sqlite4java.version>

<findbugs.version>3.0.5</findbugs.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<spring-boot-starter-validation.version>2.6.3</spring-boot-starter-validation.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<spring-boot-starter-validation.version>3.1.5</spring-boot-starter-validation.version>
</properties>

<dependencyManagement>
Expand All @@ -71,19 +70,12 @@
<version>${spring-data.version}</version>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>


<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand All @@ -102,11 +94,11 @@
<artifactId>DynamoDBLocal</artifactId>
<version>[1.11,2.0)</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.17.1</version>
</dependency>

<dependency>
<groupId>uk.org.lidalia</groupId>
Expand Down Expand Up @@ -145,20 +137,22 @@
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>${spring-boot-starter-validation.version}</version>
</dependency>
</dependency>
<!-- SPRING DATA -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>

<!-- DynamoDB -->
Expand All @@ -169,8 +163,8 @@

<!-- CDI -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>${cdi.version}</version>
<scope>compile</scope>
</dependency>
Expand All @@ -186,11 +180,11 @@
<artifactId>DynamoDBLocal</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -336,7 +330,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<version>0.8.11</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -396,26 +390,28 @@
<configLocation>src/checkstyle.xml</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.0.4</version>
<configuration>
<effort>Max</effort>
<!-- Reports all bugs (other values are medium and max) -->
<threshold>Max</threshold>
<!-- Produces XML report <xmlOutput>true</xmlOutput> -->
<excludeFilterFile>src/spotbugs-exclude.xml</excludeFilterFile>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.1.0</version>
<configuration>
<!-- TODO: activate again -->
<skip>true</skip>
<effort>Max</effort>
<!-- Reports all bugs (other values are medium and max) -->
<threshold>Max</threshold>
<!-- Produces XML report <xmlOutput>true</xmlOutput> -->
<excludeFilterFile>src/spotbugs-exclude.xml</excludeFilterFile>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down Expand Up @@ -648,31 +644,31 @@
<skipDeploy>true</skipDeploy>
</configuration>
</plugin>
<plugin>
<!-- Deploy the web site -->
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<!-- select the Maven phase in which the plugin will be executed -->
<phase>site-deploy</phase>
<configuration>
<!-- Plugin configuration ges here -->
<server>github</server>
<!-- The commit message -->
<message>Building site</message>
<!-- The location where the site is uploaded -->
<path>${site.path}</path>
<!-- Use merge or override the content -->
<merge>true</merge>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Deploy the web site -->
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<!-- select the Maven phase in which the plugin will be executed -->
<phase>site-deploy</phase>
<configuration>
<!-- Plugin configuration ges here -->
<server>github</server>
<!-- The commit message -->
<message>Building site</message>
<!-- The location where the site is uploaded -->
<path>${site.path}</path>
<!-- Use merge or override the content -->
<merge>true</merge>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -692,7 +688,7 @@
<timezone>0</timezone>
</developer>
<developer>
<id>derjust</id>
<id>derjust</id>
<name>Sebastian J</name>
<email>[email protected]</email>
<timezone>America/New_York</timezone>
Expand Down Expand Up @@ -739,7 +735,7 @@
<name>Rene Enriquez</name>
<url>enriquezrene</url>
</contributor>
<contributor>
<contributor>
<name>Ryon Day</name>
<url>https://github.com/ryonday</url>
</contributor>
Expand All @@ -763,8 +759,8 @@
</distributionManagement>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/boostchicken/spring-data-dynamodb/issues</url>
<system>GitHub</system>
<url>https://github.com/boostchicken/spring-data-dynamodb/issues</url>
</issueManagement>

<ciManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
import org.springframework.data.auditing.config.AuditingBeanDefinitionRegistrarSupport;
import org.springframework.data.auditing.config.AuditingConfiguration;
import org.springframework.data.config.ParsingUtils;
import org.springframework.data.repository.config.PersistentEntitiesFactoryBean;
import org.springframework.util.Assert;

import java.lang.annotation.Annotation;

import static org.socialsignin.spring.data.dynamodb.config.BeanNames.MAPPING_CONTEXT_BEAN_NAME;
import static org.springframework.beans.factory.config.BeanDefinition.ROLE_INFRASTRUCTURE;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition;

/**
* {@link org.springframework.context.annotation.ImportBeanDefinitionRegistrar}
Expand Down Expand Up @@ -97,8 +99,11 @@ protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingCon
LOGGER.trace("getAuditHandlerBeanDefinitionBuilder");
Assert.notNull(configuration, "AuditingConfiguration must not be null!");

BeanDefinitionBuilder persistentEntities = rootBeanDefinition(PersistentEntitiesFactoryBean.class);
persistentEntities.addConstructorArgReference(MAPPING_CONTEXT_BEAN_NAME);

BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(IsNewAwareAuditingHandler.class);
builder.addConstructorArgReference(MAPPING_CONTEXT_BEAN_NAME);
builder.addConstructorArgValue(persistentEntities.getBeanDefinition());
return configureDefaultAuditHandlerAttributes(configuration, builder);
}

Expand Down Expand Up @@ -151,4 +156,4 @@ private void defaultDependenciesIfNecessary(BeanDefinitionRegistry registry, Obj
registry.registerBeanDefinition(MAPPING_CONTEXT_BEAN_NAME, definition);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
/**
* @return Configures a
* {@link org.springframework.data.auditing.DateTimeProvider} bean name
* that allows customizing the {@link org.joda.time.DateTime} to be used
* that allows customizing the {@link java.time.LocalDateTime} to be used
* for setting creation and modification dates.
*/
String dateTimeProviderRef() default "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ public Date unmarshall(Class<Date> clazz, String obj) throws IllegalArgumentExce
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;

import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.Validator;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.ConstraintViolationException;
import jakarta.validation.Validator;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
* javax.validation dependant entities validator. When it is registered as
* jakarta.validation dependant entities validator. When it is registered as
* Spring component its automatically invoked before entities are saved in
* database.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@
* @return expression value mappings for query
*/
ExpressionAttribute[] expressionMappingValues() default @ExpressionAttribute;
}
}
Loading