Migrate to jdk 21 (#2295)

* docker containers using images with jre 21
* project is still building with target java 17 - so jar artifacts are java 17 compatible
* provided option to have different version for client libraries (e.g. ddi and management REST api)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-03-27 09:28:28 +02:00
committed by GitHub
parent 21ec2e581a
commit 70949769de
10 changed files with 20 additions and 8 deletions

View File

@@ -29,7 +29,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
java-version: 21
cache: "maven"
- name: Create hawkBit container images

View File

@@ -32,11 +32,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21
cache: 'maven'
- name: Cache local Maven repository

View File

@@ -32,11 +32,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21
cache: 'maven'
- name: Cache local Maven repository

View File

@@ -1,5 +1,5 @@
# set Java
ARG JAVA_VERSION=17.0.14_7
ARG JAVA_VERSION=21.0.6_7
# extracts spring layers from the app jar (to optimize boot)
FROM eclipse-temurin:${JAVA_VERSION}-jre-alpine as build

View File

@@ -1,5 +1,5 @@
# set Java
ARG JAVA_VERSION=17.0.14_7
ARG JAVA_VERSION=21.0.6_7
# extracts spring layers from the app jar (to optimize boot)
FROM eclipse-temurin:${JAVA_VERSION}-jre-alpine as build

View File

@@ -23,6 +23,10 @@
<artifactId>hawkbit-ddi-api</artifactId>
<name>hawkBit :: DDI :: REST API</name>
<properties>
<java.version>${java.client.version}</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>

View File

@@ -21,6 +21,10 @@
<artifactId>hawkbit-mgmt-api</artifactId>
<name>hawkBit :: Management :: REST API</name>
<properties>
<java.version>${java.client.version}</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>

View File

@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.firewall.FirewalledRequest;
import org.springframework.security.web.firewall.HttpFirewall;

View File

@@ -27,6 +27,7 @@
<spring-cloud-starter-openfeign.version>4.2.1</spring-cloud-starter-openfeign.version>
<openfeign-hc5.version>13.5</openfeign-hc5.version>
<bouncycastle.version>1.80</bouncycastle.version>
<java.version>${java.client.version}</java.version>
</properties>
<modules>

View File

@@ -37,6 +37,9 @@
<properties>
<revision>0-SNAPSHOT</revision>
<java.version>17</java.version>
<!-- java.version is used to build the hawkbit in general, however, some artifacts which could be used
as libraries in other projects might be compiled with a different, lower, java version. -->
<java.client.version>17</java.client.version>
<snapshotDependencyAllowed>true</snapshotDependencyAllowed>