From 8197fa3c0ed8ff49763da845bb51d36345ad1e8b Mon Sep 17 00:00:00 2001 From: vinothon84 Date: Tue, 23 Jan 2024 16:20:23 +0000 Subject: [PATCH] HOCS-6852- Initial build changes for spring boot 3 --- build.gradle | 21 ++++++++++++------- .../ho/hocs/document/HocsDocsApplication.java | 2 +- .../LocalDateAttributeConverter.java | 4 ++-- .../LocalDateTimeAttributeConverter.java | 4 ++-- .../document/application/RequestData.java | 6 +++--- .../ho/hocs/document/model/DocumentData.java | 2 +- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 3f5dd5a3..68e5cabc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,12 @@ plugins { id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.1.3' + id 'org.springframework.boot' version '3.1.5' + id 'io.spring.dependency-management' version '1.1.0' } def camelVersion = '2.25.4' -def lombokVersion = '1.18.28' +var s3MockVersion = '2.11.0' +def lombokVersion = '1.18.24' group = 'uk.gov.digital.ho.hocs' sourceCompatibility = JavaVersion.VERSION_17 @@ -25,28 +26,34 @@ dependencies { implementation 'net.logstash.logback:logstash-logback-encoder:7.3' + configurations.all { + exclude group: "commons-logging", module: "commons-logging" + } + implementation "org.apache.camel:camel-spring-boot:${camelVersion}" implementation "org.apache.camel:camel-jackson:${camelVersion}" implementation "org.apache.camel:camel-aws:${camelVersion}" implementation "org.apache.camel:camel-http4:${camelVersion}" implementation 'org.apache.httpcomponents:httpmime:4.5.14' - implementation 'com.amazonaws:aws-java-sdk:1.12.137' + implementation 'com.amazonaws:aws-java-sdk:1.12.472' implementation 'org.glassfish:javax.json:1.0.4' - implementation 'org.flywaydb:flyway-core:8.5.13' + implementation 'org.flywaydb:flyway-core:9.19.3' runtimeOnly 'org.postgresql:postgresql:42.6.0' compileOnly "org.projectlombok:lombok:${lombokVersion}" annotationProcessor "org.projectlombok:lombok:${lombokVersion}" annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' - testImplementation 'org.awaitility:awaitility:4.2.0' - testImplementation 'com.github.tomakehurst:wiremock-standalone:3.0.1' + testImplementation 'com.github.tomakehurst:wiremock-standalone:2.27.2' testImplementation "org.apache.camel:camel-test-spring:${camelVersion}" testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.assertj:assertj-core' + testImplementation "com.adobe.testing:s3mock-junit4:${s3MockVersion}" + testImplementation "com.adobe.testing:s3mock:${s3MockVersion}" } jar { enabled = false + duplicatesStrategy(DuplicatesStrategy.EXCLUDE) } diff --git a/src/main/java/uk/gov/digital/ho/hocs/document/HocsDocsApplication.java b/src/main/java/uk/gov/digital/ho/hocs/document/HocsDocsApplication.java index 953e1bb7..4a0b17b8 100644 --- a/src/main/java/uk/gov/digital/ho/hocs/document/HocsDocsApplication.java +++ b/src/main/java/uk/gov/digital/ho/hocs/document/HocsDocsApplication.java @@ -4,7 +4,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import javax.annotation.PreDestroy; +import jakarta.annotation.PreDestroy; @SpringBootApplication @Slf4j diff --git a/src/main/java/uk/gov/digital/ho/hocs/document/application/LocalDateAttributeConverter.java b/src/main/java/uk/gov/digital/ho/hocs/document/application/LocalDateAttributeConverter.java index 30a9c6fb..7c9f6fff 100644 --- a/src/main/java/uk/gov/digital/ho/hocs/document/application/LocalDateAttributeConverter.java +++ b/src/main/java/uk/gov/digital/ho/hocs/document/application/LocalDateAttributeConverter.java @@ -1,7 +1,7 @@ package uk.gov.digital.ho.hocs.document.application; -import javax.persistence.AttributeConverter; -import javax.persistence.Converter; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; import java.sql.Date; import java.time.LocalDate; diff --git a/src/main/java/uk/gov/digital/ho/hocs/document/application/LocalDateTimeAttributeConverter.java b/src/main/java/uk/gov/digital/ho/hocs/document/application/LocalDateTimeAttributeConverter.java index 6c10a80d..57262258 100644 --- a/src/main/java/uk/gov/digital/ho/hocs/document/application/LocalDateTimeAttributeConverter.java +++ b/src/main/java/uk/gov/digital/ho/hocs/document/application/LocalDateTimeAttributeConverter.java @@ -1,7 +1,7 @@ package uk.gov.digital.ho.hocs.document.application; -import javax.persistence.AttributeConverter; -import javax.persistence.Converter; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; import java.sql.Timestamp; import java.time.LocalDateTime; diff --git a/src/main/java/uk/gov/digital/ho/hocs/document/application/RequestData.java b/src/main/java/uk/gov/digital/ho/hocs/document/application/RequestData.java index c4fe6e38..f4eedfaa 100644 --- a/src/main/java/uk/gov/digital/ho/hocs/document/application/RequestData.java +++ b/src/main/java/uk/gov/digital/ho/hocs/document/application/RequestData.java @@ -25,7 +25,7 @@ public class RequestData implements HandlerInterceptor { public static final String ANONYMOUS = "anonymous"; - @Override + //@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { MDC.clear(); MDC.put(CORRELATION_ID_HEADER, initialiseCorrelationId(request)); @@ -35,7 +35,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons return true; } - @Override + // @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, @@ -43,7 +43,7 @@ public void postHandle(HttpServletRequest request, MDC.clear(); } - @Override + //@Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, diff --git a/src/main/java/uk/gov/digital/ho/hocs/document/model/DocumentData.java b/src/main/java/uk/gov/digital/ho/hocs/document/model/DocumentData.java index 311cceda..5d304d15 100644 --- a/src/main/java/uk/gov/digital/ho/hocs/document/model/DocumentData.java +++ b/src/main/java/uk/gov/digital/ho/hocs/document/model/DocumentData.java @@ -5,7 +5,7 @@ import lombok.Setter; import uk.gov.digital.ho.hocs.document.exception.ApplicationExceptions; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; import java.util.UUID;