Skip to content

Commit 238722d

Browse files
CME-47 update to java 21 (#155)
1 parent 635c59e commit 238722d

File tree

7 files changed

+32
-26
lines changed

7 files changed

+32
-26
lines changed

.github/workflows/dependency-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
path: ~/.gradle/caches
2626
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
2727
restore-keys: ${{ runner.os }}-gradle-
28-
- name: Set up JDK 11
29-
uses: actions/setup-java@v3
28+
- name: Set up JDK 21
29+
uses: actions/setup-java@v4
3030
with:
31-
java-version: 11
31+
java-version: 21
3232
distribution: 'zulu'
3333
- name: Run dependencyCheck
3434
run: ./gradlew dependencyCheckAggregate

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dist: xenial
22
sudo: required
33
language: java
44
jdk:
5-
- openjdk11
5+
- openjdk21
66
before_cache:
77
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
88
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# renovate: datasource=github-releases depName=microsoft/ApplicationInsights-Java
2-
ARG APP_INSIGHTS_AGENT_VERSION=3.4.13
3-
FROM hmctspublic.azurecr.io/base/java:17-distroless
2+
ARG APP_INSIGHTS_AGENT_VERSION=3.5.4
3+
FROM hmctspublic.azurecr.io/base/java:21-distroless
44

55
USER hmcts
66
COPY lib/applicationinsights.json /opt/app/

build.gradle

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ plugins {
33
id 'checkstyle'
44
id 'jacoco'
55
id 'java'
6-
id "io.freefair.lombok" version "6.6.3"
6+
id "io.freefair.lombok" version "8.10.2"
77
id 'io.spring.dependency-management' version '1.1.0'
8-
id 'org.springframework.boot' version '2.7.12'
8+
id 'org.springframework.boot' version '2.7.18'
99
id 'com.github.kt3k.coveralls' version '2.12.2'
10-
id 'com.github.ben-manes.versions' version '0.46.0'
11-
id 'org.sonarqube' version '3.5.0.2730'
12-
id 'uk.gov.hmcts.java' version '0.12.43'
10+
id 'com.github.ben-manes.versions' version '0.51.0'
11+
id 'org.sonarqube' version '5.1.0.4882'
12+
id 'uk.gov.hmcts.java' version '0.12.63'
1313
}
1414

1515
group = 'uk.gov.hmcts.reform'
1616
version = '0.0.1'
1717

1818
java {
1919
toolchain {
20-
languageVersion = JavaLanguageVersion.of(17)
20+
languageVersion = JavaLanguageVersion.of(21)
2121
}
2222
}
2323

@@ -98,7 +98,7 @@ task integration(type: Test) {
9898
}
9999

100100
task fortifyScan(type: JavaExec) {
101-
main = "uk.gov.hmcts.fortifyclient.FortifyClientMainApp"
101+
mainClass = "uk.gov.hmcts.fortifyclient.FortifyClientMainApp"
102102
classpath += sourceSets.test.runtimeClasspath
103103
jvmArgs = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED']
104104
}
@@ -120,7 +120,7 @@ jacocoTestReport {
120120
reports {
121121
xml.required = true
122122
csv.required = false
123-
xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
123+
xml.outputLocation = file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
124124
}
125125
}
126126

@@ -132,7 +132,7 @@ sonarqube {
132132
property "sonar.projectName", "ccd-case-migration-starter"
133133
property "sonar.projectKey", "ccd-case-migration-starter"
134134
property "sonar.exclusions", "**/exception/*.java,**/domain/*.java,**/common/*.java,**/migration/auth/AuthTokenGeneratorConfiguration.java,**/migration/CaseMigrationRunner.java,**/ccd/HttpMessageConverterConfiguration.java"
135-
property "sonar.coverage.jacoco.xmlReportPaths", "${jacocoTestReport.reports.xml.destination.path}"
135+
property "sonar.coverage.jacoco.xmlReportPaths", "${jacocoTestReport.reports.xml.outputLocation}"
136136
}
137137
}
138138

@@ -163,7 +163,7 @@ repositories {
163163
ext {
164164
log4JVersion = "2.20.0"
165165
restAssuredVersion = '4.3.0!!'
166-
lombokVersion = "1.18.28"
166+
lombokVersion = "1.18.34"
167167
junit_version = "4.12"
168168
junitJupiterVersion = '5.9.3'
169169
junitVintageVersion = '5.9.3'
@@ -246,7 +246,9 @@ dependencyManagement {
246246
}
247247
}
248248

249-
mainClassName = 'uk.gov.hmcts.reform.migration.CaseMigrationRunner'
249+
application {
250+
mainClass = 'uk.gov.hmcts.reform.migration.CaseMigrationRunner'
251+
}
250252

251253
bootJar {
252254
archiveFileName = 'ccd-case-migration.jar'
@@ -284,7 +286,7 @@ test {
284286
}
285287

286288
reports {
287-
html.enabled = true
289+
html.required = true
288290
}
289291

290292
jvmArgs = [
@@ -297,4 +299,3 @@ test {
297299
'--add-opens', 'jdk.management/com.sun.management.internal=ALL-UNNAMED'
298300
]
299301
}
300-

gradle/wrapper/gradle-wrapper.jar

1.76 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -133,26 +130,29 @@ location of your Java installation."
133130
fi
134131
else
135132
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137136
138137
Please set the JAVA_HOME variable in your environment to match the
139138
location of your Java installation."
139+
fi
140140
fi
141141

142142
# Increase the maximum file descriptors if we can.
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146146
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
147+
# shellcheck disable=SC3045
148148
MAX_FD=$( ulimit -H -n ) ||
149149
warn "Could not query maximum file descriptor limit"
150150
esac
151151
case $MAX_FD in #(
152152
'' | soft) :;; #(
153153
*)
154154
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
155+
# shellcheck disable=SC3045
156156
ulimit -n "$MAX_FD" ||
157157
warn "Could not set maximum file descriptor limit to $MAX_FD"
158158
esac
@@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
197197
done
198198
fi
199199

200+
201+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203+
200204
# Collect all arguments for the java command;
201205
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202206
# shell script including quotes and variable substitutions, so put them in

0 commit comments

Comments
 (0)