From f324c7c8aad6aba18fe2341a864984c4e342f509 Mon Sep 17 00:00:00 2001 From: Rapolas <130578328+rapolaskaseliscgi@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:30:05 +0000 Subject: [PATCH] CME-43 java 21 upgrade (#1514) --- .github/workflows/dependency-check.yml | 6 +++--- .github/workflows/swagger.yml | 6 +++--- Dockerfile | 4 ++-- README.md | 2 +- acb.tpl.yaml | 4 ++-- build.gradle | 14 +++++++------- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index 5b14bbda7e..606de61570 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -25,10 +25,10 @@ jobs: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle- - - name: Set up JDK 17 - uses: actions/setup-java@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' - name: Run dependencyCheck run: ./gradlew dependencyCheckAggregate diff --git a/.github/workflows/swagger.yml b/.github/workflows/swagger.yml index d99fdd2673..08b0cdf11d 100644 --- a/.github/workflows/swagger.yml +++ b/.github/workflows/swagger.yml @@ -17,10 +17,10 @@ jobs: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle- - - name: Set up JDK 17 - uses: actions/setup-java@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' - name: Run Swagger Publisher run: ./gradlew application:test --tests uk.gov.hmcts.net.ccd.definition.store.SwaggerGeneratorTest diff --git a/Dockerfile b/Dockerfile index c34c76e48a..5f3e766f25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ # Keep hub.Dockerfile aligned to this file as far as possible ARG JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom" -ARG APP_INSIGHTS_AGENT_VERSION=3.4.13 +ARG APP_INSIGHTS_AGENT_VERSION=3.5.4 ARG PLATFORM="" -FROM hmctspublic.azurecr.io/base/java${PLATFORM}:17-distroless +FROM hmctspublic.azurecr.io/base/java${PLATFORM}:21-distroless # Change to non-root privilege USER hmcts diff --git a/README.md b/README.md index 8baabb203a..54ea7a0844 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ simply ignored ### Prerequisites -- [Open JDK 17](https://openjdk.java.net/) +- [Open JDK 21](https://openjdk.java.net/) - [Docker](https://www.docker.com) #### Environment variables diff --git a/acb.tpl.yaml b/acb.tpl.yaml index 3dee7f8657..730b380a3d 100644 --- a/acb.tpl.yaml +++ b/acb.tpl.yaml @@ -1,7 +1,7 @@ version: 1.0-preview-1 steps: - id: pull-base-image-amd64 - cmd: docker pull --platform linux/amd64 hmctspublic.azurecr.io/base/java:17-distroless && docker tag hmctspublic.azurecr.io/base/java:17-distroless hmctspublic.azurecr.io/base/java/linux/amd64:17-distroless + cmd: docker pull --platform linux/amd64 hmctspublic.azurecr.io/base/java:21-distroless && docker tag hmctspublic.azurecr.io/base/java:21-distroless hmctspublic.azurecr.io/base/java/linux/amd64:21-distroless when: ["-"] retries: 3 retryDelay: 5 @@ -18,7 +18,7 @@ steps: retryDelay: 5 - id: pull-base-image-arm64 - cmd: docker pull --platform linux/arm64 hmctspublic.azurecr.io/base/java:17-distroless && docker tag hmctspublic.azurecr.io/base/java:17-distroless hmctspublic.azurecr.io/base/java/linux/arm64:17-distroless + cmd: docker pull --platform linux/arm64 hmctspublic.azurecr.io/base/java:21-distroless && docker tag hmctspublic.azurecr.io/base/java:21-distroless hmctspublic.azurecr.io/base/java/linux/arm64:21-distroless when: - pull-base-image-amd64 retries: 3 diff --git a/build.gradle b/build.gradle index ca6a67b51b..aa0dfb189e 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { plugins { id 'application' - id "org.springframework.boot" version '2.7.12' + id "org.springframework.boot" version '2.7.18' id 'io.spring.dependency-management' version '1.1.5' id 'se.patrikerdes.use-latest-versions' version '0.2.7' id 'com.github.ben-manes.versions' version '0.51.0' @@ -184,7 +184,7 @@ allprojects { java { toolchain { - languageVersion = JavaLanguageVersion.of(17) + languageVersion = JavaLanguageVersion.of(21) } } @@ -262,11 +262,11 @@ subprojects { subproject -> exclude group: 'com.google.guava', module: 'guava' } - compileOnly 'org.projectlombok:lombok:1.18.28' - annotationProcessor 'org.projectlombok:lombok:1.18.28' + compileOnly 'org.projectlombok:lombok:1.18.34' + annotationProcessor 'org.projectlombok:lombok:1.18.34' - testCompileOnly 'org.projectlombok:lombok:1.18.28' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.28' + testCompileOnly 'org.projectlombok:lombok:1.18.34' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.34' implementation "org.springframework.security:spring-security-web" implementation "org.springframework.security:spring-security-config" @@ -301,7 +301,7 @@ subprojects { subproject -> // To avoid compiler warnings about @API annotations in JUnit5 code. testImplementation 'org.apiguardian:apiguardian-api:1.0.0' testImplementation "org.postgresql:postgresql:42.7.3" - testImplementation "org.testcontainers:postgresql:1.17.2" + testImplementation "org.testcontainers:postgresql:1.20.2" testImplementation "org.hamcrest:hamcrest-core:${hamcrestVersion}" testImplementation "org.hamcrest:hamcrest-library:${hamcrestVersion}" testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"