diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c489fe7..ced2189 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,18 +18,20 @@ jobs: max-parallel: 100 matrix: spring_boot_version: - - 2.7.8 - - 2.6.14 - - 2.5.14 + - 3.0.6 env: SPRING_BOOT_VERSION: ${{ matrix.spring_boot_version }} steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'zulu' - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - gradle-version: "8.0" gradle-home-cache-cleanup: true # Comment out when you are upgrading gradle in a branch and doing tons of commits you would need to test. # cache-read-only: false @@ -102,7 +104,6 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - gradle-version: "8.0" gradle-home-cache-cleanup: true # Comment out when you are upgrading gradle in a branch and doing tons of commits you would need to test. # cache-read-only: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 592fa8c..3f1f44e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.0] - 2023-05-06 + +### Changed + +* Moving from `javax` packages to `jakarta`. + That means we will start supporting JDK 17 and Spring Boot 3 only from now on. + Cloned `javax` version to `transferwise/tw-gaffer-jta-javax` repository, for case we need to do urgent changes for older services. + +* Jakarta Validation is done now programmatically. + Somehow the `@Validated` annotation based validation considerable slowed down the application startup. + ## [2.2.0] - 2023-03-30 ### Changed diff --git a/build.common.gradle b/build.common.gradle index 16f6527..83f55e2 100644 --- a/build.common.gradle +++ b/build.common.gradle @@ -44,8 +44,8 @@ configurations { } java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 withSourcesJar() withJavadocJar() } @@ -60,9 +60,14 @@ jar { } dependencies { - local platform(libraries.springBootDependencies + '!!') - local libraries.lombok - local libraries.spotbugsAnnotations + local platform(libraries.springBootDependencies) + + compileOnly libraries.lombok + annotationProcessor libraries.lombok + testCompileOnly libraries.lombok + testAnnotationProcessor libraries.lombok + + compileOnly libraries.spotbugsAnnotations } compileJava { @@ -73,19 +78,9 @@ compileJava { options.fork = true options.forkOptions.jvmArgs << '-Xmx256m' - - javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(11) - } } compileTestJava { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(17) - } - options.fork = true options.forkOptions.jvmArgs << '-Xmx256m' } @@ -117,9 +112,6 @@ jar { } test { - javaLauncher = javaToolchains.launcherFor { - languageVersion = JavaLanguageVersion.of(17) - } useJUnitPlatform() jvmArgs("-Xmx512m") testLogging { diff --git a/build.gradle b/build.gradle index df65785..7592b97 100644 --- a/build.gradle +++ b/build.gradle @@ -2,15 +2,15 @@ import org.eclipse.jgit.api.errors.RefAlreadyExistsException plugins { id "idea" - id 'com.github.spotbugs' version '5.0.13' - id 'org.ajoberstar.grgit' version '5.0.0' + id 'com.github.spotbugs' version '5.0.14' + id 'org.ajoberstar.grgit' version '5.2.0' id 'io.github.gradle-nexus.publish-plugin' version "1.1.0" } ext.projectName = 'TransferWise Gaffer 1PC JTA' ext.projectDescription = 'Transferwise Gaffer 1PC JTA - efficient 1PC JTA for enterprise services' ext.projectGitHubRepoName = 'tw-gaffer-jta' -ext.projectArtifactName = 'tw-gaffer-jta' +ext.projectArtifactName = 'tw-gaffer-jta-jakarta' apply from: 'build.common.gradle' diff --git a/build.libraries.gradle b/build.libraries.gradle index c7784a0..3b0d31c 100644 --- a/build.libraries.gradle +++ b/build.libraries.gradle @@ -1,22 +1,22 @@ ext { - springBootVersion = System.getenv("SPRING_BOOT_VERSION") ?: "2.6.14" + springBootVersion = System.getenv("SPRING_BOOT_VERSION") ?: "3.0.6" libraries = [ // explicit versions guava : 'com.google.guava:guava:31.1-jre', spotbugsAnnotations : "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}", springBootDependencies : "org.springframework.boot:spring-boot-dependencies:${springBootVersion}", - twBaseUtils : 'com.transferwise.common:tw-base-utils:1.9.0', + twBaseUtils : 'com.transferwise.common:tw-base-utils:1.10.1', // versions managed by spring-boot-dependencies platform commonsLang3 : 'org.apache.commons:commons-lang3', hamcrestCore : 'org.hamcrest:hamcrest-core', - hibernateCore : 'org.hibernate:hibernate-core', + hibernateCore : 'org.hibernate.orm:hibernate-core', hikariCp : "com.zaxxer:HikariCP", hsqldb : 'org.hsqldb:hsqldb', jakartaAnnotationApi : 'jakarta.annotation:jakarta.annotation-api', jakartaValidationApi : 'jakarta.validation:jakarta.validation-api', - javaxTransactionApi : "javax.transaction:javax.transaction-api", + jakartaTransactionApi : "jakarta.transaction:jakarta.transaction-api", lombok : 'org.projectlombok:lombok', mariadbJavaClient : 'org.mariadb.jdbc:mariadb-java-client', slf4jApi : 'org.slf4j:slf4j-api', diff --git a/build.library.gradle b/build.library.gradle index adb0a2c..30a3cf9 100644 --- a/build.library.gradle +++ b/build.library.gradle @@ -53,6 +53,11 @@ publishing { developerConnection = projectScmConnection url = projectScmUrl } + withXml { + if (!asNode().dependencyManagement.isEmpty()){ + throw new IllegalStateException("There should not be any `dependencyManagement` block in POM.") + } + } } } } diff --git a/gradle.properties b/gradle.properties index 13794c2..4950f0d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=2.2.0 +version=3.0.0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..ccebba7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da1db5f..37aef8d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb..79a61d4 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac diff --git a/gradlew.bat b/gradlew.bat index 53a6b23..6689b85 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/tw-gaffer-jta-starter/build.gradle b/tw-gaffer-jta-starter/build.gradle index 4a3c588..abf4aa3 100644 --- a/tw-gaffer-jta-starter/build.gradle +++ b/tw-gaffer-jta-starter/build.gradle @@ -1,12 +1,12 @@ ext.projectName = "tw-gaffer-jta-starter" ext.projectDescription = "tw-gaffer-jta-starter" -ext.projectArtifactName = "tw-gaffer-jta-starter" +ext.projectArtifactName = "tw-gaffer-jta-jakarta-starter" apply from: "${project.rootDir}/build.common.gradle" apply from: "${project.rootDir}/build.library.gradle" dependencies { - api libraries.javaxTransactionApi + api libraries.jakartaTransactionApi api project(":tw-gaffer-jta") annotationProcessor libraries.springBootConfigurationProcessor diff --git a/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/DefaultEnvironmentValidator.java b/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/DefaultEnvironmentValidator.java new file mode 100644 index 0000000..514f2dd --- /dev/null +++ b/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/DefaultEnvironmentValidator.java @@ -0,0 +1,28 @@ +package com.transferwise.common.gaffer.starter; + +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.event.ApplicationPreparedEvent; +import org.springframework.context.ApplicationListener; + +public class DefaultEnvironmentValidator implements EnvironmentValidator, ApplicationListener { + + @Autowired + private GafferJtaProperties properties; + + @Autowired + private Validator validator; + + public void validate() { + var violations = validator.validate(properties); + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } + + @Override + public void onApplicationEvent(ApplicationPreparedEvent event) { + validate(); + } +} diff --git a/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/EnvironmentValidator.java b/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/EnvironmentValidator.java new file mode 100644 index 0000000..54121f4 --- /dev/null +++ b/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/EnvironmentValidator.java @@ -0,0 +1,6 @@ +package com.transferwise.common.gaffer.starter; + +public interface EnvironmentValidator { + + void validate(); +} diff --git a/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/GafferJtaConfiguration.java b/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/GafferJtaConfiguration.java index 1029f5d..202739d 100644 --- a/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/GafferJtaConfiguration.java +++ b/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/GafferJtaConfiguration.java @@ -2,8 +2,8 @@ import com.transferwise.common.gaffer.ServiceRegistry; import com.transferwise.common.gaffer.ServiceRegistryHolder; -import javax.transaction.TransactionManager; -import javax.transaction.UserTransaction; +import jakarta.transaction.TransactionManager; +import jakarta.transaction.UserTransaction; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -52,4 +52,11 @@ public GafferJtaProperties gafferJtaProperties() { public GafferJtaDataSourceBeanProcessor gafferJtaDataSourceBeanProcessor() { return new GafferJtaDataSourceBeanProcessor(); } + + @Bean + @ConditionalOnMissingBean(EnvironmentValidator.class) + public DefaultEnvironmentValidator gafferJtaEnvironmentValidator() { + return new DefaultEnvironmentValidator(); + } + } diff --git a/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/GafferJtaProperties.java b/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/GafferJtaProperties.java index 8d5cdc8..ea12afb 100644 --- a/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/GafferJtaProperties.java +++ b/tw-gaffer-jta-starter/src/main/java/com/transferwise/common/gaffer/starter/GafferJtaProperties.java @@ -1,18 +1,16 @@ package com.transferwise.common.gaffer.starter; import com.transferwise.common.gaffer.jdbc.AutoCommitStrategy; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.time.Duration; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import lombok.Data; import lombok.experimental.Accessors; -import org.springframework.validation.annotation.Validated; @Data @Accessors(chain = true) -@Validated public class GafferJtaProperties { @Valid diff --git a/tw-gaffer-jta-starter/src/main/resources/META-INF/spring.factories b/tw-gaffer-jta-starter/src/main/resources/META-INF/spring.factories deleted file mode 100644 index c7d3c42..0000000 --- a/tw-gaffer-jta-starter/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.transferwise.common.gaffer.starter.GafferJtaAutoConfiguration diff --git a/tw-gaffer-jta-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/tw-gaffer-jta-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..f7bcff7 --- /dev/null +++ b/tw-gaffer-jta-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.transferwise.common.gaffer.starter.GafferJtaAutoConfiguration diff --git a/tw-gaffer-jta/build.gradle b/tw-gaffer-jta/build.gradle index 929c69e..902d141 100644 --- a/tw-gaffer-jta/build.gradle +++ b/tw-gaffer-jta/build.gradle @@ -1,12 +1,12 @@ ext.projectName = "tw-gaffer-jta" ext.projectDescription = "tw-gaffer-jta" -ext.projectArtifactName = "tw-gaffer-jta" +ext.projectArtifactName = "tw-gaffer-jta-jakarta" apply from: "${project.rootDir}/build.common.gradle" apply from: "${project.rootDir}/build.library.gradle" dependencies { - api libraries.javaxTransactionApi + api libraries.jakartaTransactionApi implementation libraries.slf4jApi implementation libraries.commonsLang3 diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/ServiceRegistry.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/ServiceRegistry.java index bb0f4a3..050a4d6 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/ServiceRegistry.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/ServiceRegistry.java @@ -2,7 +2,7 @@ import com.transferwise.common.gaffer.util.Clock; import com.transferwise.common.gaffer.util.MonotonicClock; -import javax.transaction.TransactionSynchronizationRegistry; +import jakarta.transaction.TransactionSynchronizationRegistry; public class ServiceRegistry { diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionImpl.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionImpl.java index 70da887..1597d71 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionImpl.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionImpl.java @@ -9,6 +9,10 @@ import com.transferwise.common.gaffer.util.TransactionStatuses; import com.transferwise.common.gaffer.util.Uid; import com.transferwise.common.gaffer.util.UidImpl; +import jakarta.transaction.RollbackException; +import jakarta.transaction.Status; +import jakarta.transaction.Synchronization; +import jakarta.transaction.Transaction; import java.lang.ref.Cleaner; import java.util.ArrayList; import java.util.List; @@ -16,10 +20,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicBoolean; -import javax.transaction.RollbackException; -import javax.transaction.Status; -import javax.transaction.Synchronization; -import javax.transaction.Transaction; import javax.transaction.xa.XAException; import javax.transaction.xa.XAResource; diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionManagerImpl.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionManagerImpl.java index 32f0bd5..05b856b 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionManagerImpl.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionManagerImpl.java @@ -2,12 +2,12 @@ import com.transferwise.common.gaffer.util.ExceptionThrower; import com.transferwise.common.gaffer.util.FormatLogger; -import javax.transaction.NotSupportedException; -import javax.transaction.RollbackException; -import javax.transaction.Status; -import javax.transaction.SystemException; -import javax.transaction.Transaction; -import javax.transaction.TransactionManager; +import jakarta.transaction.NotSupportedException; +import jakarta.transaction.RollbackException; +import jakarta.transaction.Status; +import jakarta.transaction.SystemException; +import jakarta.transaction.Transaction; +import jakarta.transaction.TransactionManager; public class TransactionManagerImpl implements TransactionManager { diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionSynchronizationRegistryImpl.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionSynchronizationRegistryImpl.java index 0f5c268..b2a21a2 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionSynchronizationRegistryImpl.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/TransactionSynchronizationRegistryImpl.java @@ -1,10 +1,10 @@ package com.transferwise.common.gaffer; import com.transferwise.common.gaffer.util.ExceptionThrower; -import javax.transaction.RollbackException; -import javax.transaction.Status; -import javax.transaction.Synchronization; -import javax.transaction.TransactionSynchronizationRegistry; +import jakarta.transaction.RollbackException; +import jakarta.transaction.Status; +import jakarta.transaction.Synchronization; +import jakarta.transaction.TransactionSynchronizationRegistry; public class TransactionSynchronizationRegistryImpl implements TransactionSynchronizationRegistry { diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/UserTransactionImpl.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/UserTransactionImpl.java index f124f9e..627bc10 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/UserTransactionImpl.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/UserTransactionImpl.java @@ -1,12 +1,12 @@ package com.transferwise.common.gaffer; +import jakarta.transaction.HeuristicMixedException; +import jakarta.transaction.HeuristicRollbackException; +import jakarta.transaction.NotSupportedException; +import jakarta.transaction.RollbackException; +import jakarta.transaction.SystemException; +import jakarta.transaction.UserTransaction; import java.io.Serializable; -import javax.transaction.HeuristicMixedException; -import javax.transaction.HeuristicRollbackException; -import javax.transaction.NotSupportedException; -import javax.transaction.RollbackException; -import javax.transaction.SystemException; -import javax.transaction.UserTransaction; public class UserTransactionImpl implements UserTransaction, Serializable { diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/jdbc/GafferJtaDataSource.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/jdbc/GafferJtaDataSource.java index da63847..ef3c845 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/jdbc/GafferJtaDataSource.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/jdbc/GafferJtaDataSource.java @@ -10,13 +10,13 @@ import com.transferwise.common.gaffer.util.FormatLogger; import com.transferwise.common.gaffer.util.MBeanUtil; import com.transferwise.common.gaffer.util.XaExceptionImpl; +import jakarta.annotation.PostConstruct; +import jakarta.transaction.Status; +import jakarta.transaction.TransactionSynchronizationRegistry; import java.sql.Connection; import java.sql.SQLException; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.PostConstruct; import javax.sql.DataSource; -import javax.transaction.Status; -import javax.transaction.TransactionSynchronizationRegistry; import javax.transaction.xa.XAException; import javax.transaction.xa.XAResource; import javax.transaction.xa.Xid; diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/HeuristicMixedExceptionImpl.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/HeuristicMixedExceptionImpl.java index 495d3b1..6ef9ea7 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/HeuristicMixedExceptionImpl.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/HeuristicMixedExceptionImpl.java @@ -1,6 +1,6 @@ package com.transferwise.common.gaffer.util; -import javax.transaction.RollbackException; +import jakarta.transaction.RollbackException; public class HeuristicMixedExceptionImpl extends RollbackException { diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/RollbackExceptionImpl.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/RollbackExceptionImpl.java index 9b9423c..52a884d 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/RollbackExceptionImpl.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/RollbackExceptionImpl.java @@ -1,6 +1,6 @@ package com.transferwise.common.gaffer.util; -import javax.transaction.RollbackException; +import jakarta.transaction.RollbackException; public class RollbackExceptionImpl extends RollbackException { diff --git a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/TransactionStatuses.java b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/TransactionStatuses.java index a2a6d29..c6371bf 100644 --- a/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/TransactionStatuses.java +++ b/tw-gaffer-jta/src/main/java/com/transferwise/common/gaffer/util/TransactionStatuses.java @@ -1,6 +1,6 @@ package com.transferwise.common.gaffer.util; -import javax.transaction.Status; +import jakarta.transaction.Status; public class TransactionStatuses { diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/Client.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/Client.java index 1b26591..ab90108 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/Client.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/Client.java @@ -1,10 +1,10 @@ package com.transferwise.common.gaffer.test.complextest1.app; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; @Entity @Table(name = "clients") diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/ClientsDao.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/ClientsDao.java index 7401013..7cdf1fb 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/ClientsDao.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/ClientsDao.java @@ -1,9 +1,9 @@ package com.transferwise.common.gaffer.test.complextest1.app; import com.google.common.base.Throwables; +import jakarta.annotation.Resource; import java.sql.Connection; import java.sql.PreparedStatement; -import javax.annotation.Resource; import javax.sql.DataSource; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/ClientsService.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/ClientsService.java index 4cc5f1e..753ee42 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/ClientsService.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/ClientsService.java @@ -1,6 +1,6 @@ package com.transferwise.common.gaffer.test.complextest1.app; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/DatabasesManager.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/DatabasesManager.java index 8c03956..2a6deda 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/DatabasesManager.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/DatabasesManager.java @@ -1,12 +1,12 @@ package com.transferwise.common.gaffer.test.complextest1.app; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.annotation.Resource; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.annotation.Resource; import javax.sql.DataSource; import org.springframework.stereotype.Component; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/UsersDao.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/UsersDao.java index 0c4d1d0..074ebcb 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/UsersDao.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/UsersDao.java @@ -1,9 +1,9 @@ package com.transferwise.common.gaffer.test.complextest1.app; import com.google.common.base.Throwables; +import jakarta.annotation.Resource; import java.sql.Connection; import java.sql.PreparedStatement; -import javax.annotation.Resource; import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DataSourceUtils; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/UsersService.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/UsersService.java index 37bbca3..e5b8a9b 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/UsersService.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/complextest1/app/UsersService.java @@ -1,6 +1,6 @@ package com.transferwise.common.gaffer.test.complextest1.app; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/SuspendedIntTest.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/SuspendedIntTest.java index 901f14b..157b64f 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/SuspendedIntTest.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/SuspendedIntTest.java @@ -6,7 +6,7 @@ import com.transferwise.common.gaffer.test.suspended.app.ClientsService; import com.transferwise.common.gaffer.test.suspended.app.DatabasesManager; import com.transferwise.common.gaffer.util.FormatLogger; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import javax.sql.DataSource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/ClientsDao.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/ClientsDao.java index 703a6df..ffc92b1 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/ClientsDao.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/ClientsDao.java @@ -1,7 +1,7 @@ package com.transferwise.common.gaffer.test.suspended.app; import com.transferwise.common.gaffer.util.FormatLogger; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/ClientsService.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/ClientsService.java index f81214a..1caacd7 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/ClientsService.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/ClientsService.java @@ -1,6 +1,6 @@ package com.transferwise.common.gaffer.test.suspended.app; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/DatabasesManager.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/DatabasesManager.java index d69c218..17c65e4 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/DatabasesManager.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/DatabasesManager.java @@ -1,12 +1,12 @@ package com.transferwise.common.gaffer.test.suspended.app; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.annotation.Resource; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.annotation.Resource; import javax.sql.DataSource; import org.springframework.stereotype.Component; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/LogsDao.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/LogsDao.java index fbfcc31..ddd4852 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/LogsDao.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/LogsDao.java @@ -1,6 +1,6 @@ package com.transferwise.common.gaffer.test.suspended.app; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/LogsService.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/LogsService.java index 9d75dfe..a90cec3 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/LogsService.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/suspended/app/LogsService.java @@ -1,6 +1,6 @@ package com.transferwise.common.gaffer.test.suspended.app; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; diff --git a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/testsuitea/TestApplication.java b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/testsuitea/TestApplication.java index de744fc..f50d8c8 100644 --- a/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/testsuitea/TestApplication.java +++ b/tw-gaffer-jta/src/test/java/com/transferwise/common/gaffer/test/testsuitea/TestApplication.java @@ -5,9 +5,9 @@ import com.transferwise.common.gaffer.jdbc.GafferJtaDataSource; import com.transferwise.common.gaffer.test.TestClock; import com.zaxxer.hikari.HikariDataSource; +import jakarta.transaction.TransactionManager; +import jakarta.transaction.UserTransaction; import javax.sql.DataSource; -import javax.transaction.TransactionManager; -import javax.transaction.UserTransaction; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.transaction.annotation.EnableTransactionManagement;