Skip to content

Commit

Permalink
chore: upgraded to JDK 21 (#591)
Browse files Browse the repository at this point in the history
Upgraded the ZAC Java JDK to 21. Also set source and target
compatibility to JDK 21. #minor

Solves PZ-1492
  • Loading branch information
edgarvonk authored Feb 19, 2024
1 parent 53c1eea commit 5765f0d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
cancel-in-progress: true

env:
JAVA_VERSION: '17'
JAVA_VERSION: '21'
CONTAINER_REGISTRY_URL: 'ghcr.io/infonl'
APPLICATION_NAME: 'zaakafhandelcomponent'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- cron: "21 11 * * 0"

env:
JAVA_VERSION: "17"
JAVA_VERSION: "21"

jobs:
analyze:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Create runtime image fase
FROM docker.io/eclipse-temurin:17-jre-focal as runtime
FROM docker.io/eclipse-temurin:21-jre-alpine as runtime

# Import certificates into Java truststore
ADD certificates /certificates
Expand All @@ -12,7 +12,7 @@ RUN keytool -importcert -cacerts -alias Staat_der_Nederlanden_Private_Services_C
COPY target/zaakafhandelcomponent.jar /

# Copy build timestamp (used by HealthCheckService.java)
RUN date --iso-8601='seconds' > /build_timestamp.txt
RUN date -Iseconds > /build_timestamp.txt

# Start zaakafhandelcomponent
ENTRYPOINT ["java", "--enable-preview", "-jar", "zaakafhandelcomponent.jar"]
Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ repositories {
group = "net.atos.common-ground"
description = "Zaakafhandelcomponent"

// we will only upgrade Java when WildFly explicitly supports a new version
val javaVersion = JavaVersion.VERSION_17
// make sure the Java version is supported by WildFly
// and update our base Docker image and JDK versions in our GitHubs workflows accordingly
val javaVersion = JavaVersion.VERSION_21

val zacDockerImage by extra {
if (project.hasProperty("zacDockerImage")) {
Expand Down Expand Up @@ -166,7 +167,7 @@ detekt {
}

jacoco {
toolVersion = "0.8.7"
toolVersion = "0.8.11"
}

java {
Expand Down Expand Up @@ -301,7 +302,6 @@ tasks {

withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("--enable-preview")
}

withType<org.openapitools.generator.gradle.plugin.tasks.GenerateTask> {
Expand Down
4 changes: 2 additions & 2 deletions docs/development/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ General ZAC usage instructions may be found in the [README.md](../../README.md)

### Prerequisites

- Java JDK 17 (we use the `Temurin` distribution)
- Java JDK 21 (we use the `Temurin` distribution)

### Gradle build

Expand Down Expand Up @@ -72,7 +72,7 @@ When opening the ZAC project in IntelliJ make sure to select 'Open as Gradle pro
#### Prerequisites

First you will need to set up IntelliJ for ZAC:
1. Install and use JDK 17 (we use the `Temurin` distribution).
1. Install and use the correct JDK distribution (see above).
2. Follow the [local WildFly instructions](../../scripts/wildfly/README.md) and install `WildFly`.
3. Enable the built-in IntelliJ WildFly extension if not already enabled (note that this requires the IntelliJ Enterprise Edition).
4. Create a run configuration using the WildFly extension for ZAC using the `JBoss/Wildfly Server - local` template.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ private String convertGeboortedatum(final AbstractDatum abstractDatum) {

private String convertVerblijfplaats(final AbstractVerblijfplaats abstractVerblijfplaats) {
return switch (abstractVerblijfplaats) {
case Adres adres && adres.getVerblijfadres() != null ->
case Adres adres when adres.getVerblijfadres() != null ->
convertVerblijfadresBinnenland(adres.getVerblijfadres());
case VerblijfplaatsBuitenland verblijfplaatsBuitenland && verblijfplaatsBuitenland.getVerblijfadres() != null ->
case VerblijfplaatsBuitenland verblijfplaatsBuitenland when verblijfplaatsBuitenland.getVerblijfadres() != null ->
convertVerblijfadresBuitenland(verblijfplaatsBuitenland.getVerblijfadres());
case VerblijfplaatsOnbekend verblijfplaatsOnbekend -> ONBEKEND;
default -> null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ private static String replaceInitiatorVariabelenResultaatItem(final String resol

private static String convertAdres(final Persoon persoon) {
return switch (persoon.getVerblijfplaats()) {
case Adres adres && adres.getVerblijfadres() != null -> convertAdres(adres.getVerblijfadres());
case VerblijfplaatsBuitenland verblijfplaatsBuitenland && verblijfplaatsBuitenland.getVerblijfadres() != null ->
case Adres adres when adres.getVerblijfadres() != null -> convertAdres(adres.getVerblijfadres());
case VerblijfplaatsBuitenland verblijfplaatsBuitenland when verblijfplaatsBuitenland.getVerblijfadres() != null ->
convertAdres(verblijfplaatsBuitenland.getVerblijfadres());
default -> EMPTY;
};
Expand Down

0 comments on commit 5765f0d

Please sign in to comment.