diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4982619..673c9a8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -24,7 +24,7 @@ jobs: java-version: '21' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Run Gradle 'build' Task run: ./gradlew build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7d4af32..87c540e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: java-version: '21' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -35,9 +35,9 @@ jobs: - name: Build and Push Native Image env: - QUARKUS_CONTAINER_IMAGE_BUILD: true QUARKUS_CONTAINER_IMAGE_PUSH: true - QUARKUS_PACKAGE_TYPE: native + QUARKUS_PACKAGE_JAR_ENABLED: false + QUARKUS_NATIVE_ENABLED: true QUARKUS_NATIVE_COMPRESSION_LEVEL: 9 run: ./gradlew clean build @@ -69,8 +69,9 @@ jobs: - name: Build and Push JVM Images env: - QUARKUS_CONTAINER_IMAGE_BUILD: true QUARKUS_CONTAINER_IMAGE_PUSH: true + QUARKUS_PACKAGE_JAR_ENABLED: true + QUARKUS_NATIVE_ENABLED: false QUARKUS_PACKAGE_JAR_TYPE: mutable-jar QUARKUS_DOCKER_BUILDX_PLATFORM: linux/amd64,linux/arm64 run: ./gradlew clean build -PimageTagSuffix=jvm diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a6bbf4d..31960fd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -86,14 +86,26 @@ spotless { quarkus { set("native.container-build", "true") + set("container-image.build", "true") set("container-image.group", "dnl50") set("container-image.name", "tsa-server") - set("container-image.tag", objects.property().value(provider { + set("container-image.tag", provider { if (project.hasProperty("imageTagSuffix")) { "${project.version}-${project.property("imageTagSuffix")}" } else { project.version.toString() } - })) + }) finalName.set("tsa-${project.version}") } + +tasks.check { + dependsOn(tasks.testNative) +} + +// for some reason quarkus does recognize that the JDBC URL is set in the prod profile. therefore it +// creates a h2 db in server mode (using the H2DevServicesProcessor) which runs on the host machine and sets the JDBC URL +// to something like "jdbc:h2:tcp://localhost:53233/mem:test" which obviously does not work inside the docker container +tasks.testNative { + systemProperty("quarkus.datasource.jdbc.url", "jdbc:h2:file:/work/data/tsa") +} \ No newline at end of file diff --git a/app/src/main/docker/Dockerfile.jvm b/app/src/main/docker/Dockerfile.jvm index 1a81c6c..5d67ce4 100644 --- a/app/src/main/docker/Dockerfile.jvm +++ b/app/src/main/docker/Dockerfile.jvm @@ -1,5 +1,5 @@ # Based on Quarkus' Dockerfile.jvm template for Gradle -FROM registry.access.redhat.com/ubi8/openjdk-21-runtime:1.19 +FROM registry.access.redhat.com/ubi8/openjdk-21-runtime:1.20 ENV LANGUAGE='en_US:en' diff --git a/app/src/main/docker/Dockerfile.native b/app/src/main/docker/Dockerfile.native index 9d59cbf..405e4cb 100644 --- a/app/src/main/docker/Dockerfile.native +++ b/app/src/main/docker/Dockerfile.native @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 WORKDIR /work/ RUN chown 1001 /work \ && mkdir /work/data \ diff --git a/app/src/integrationTest/java/dev/mieser/tsa/nativetest/KeystoreResourceLifecycleManager.java b/app/src/native-test/java/dev/mieser/tsa/nativetest/KeystoreResourceLifecycleManager.java similarity index 100% rename from app/src/integrationTest/java/dev/mieser/tsa/nativetest/KeystoreResourceLifecycleManager.java rename to app/src/native-test/java/dev/mieser/tsa/nativetest/KeystoreResourceLifecycleManager.java diff --git a/app/src/integrationTest/java/dev/mieser/tsa/nativetest/NativeApplicationSmokeTest.java b/app/src/native-test/java/dev/mieser/tsa/nativetest/NativeApplicationSmokeTest.java similarity index 99% rename from app/src/integrationTest/java/dev/mieser/tsa/nativetest/NativeApplicationSmokeTest.java rename to app/src/native-test/java/dev/mieser/tsa/nativetest/NativeApplicationSmokeTest.java index ff2393d..831534d 100644 --- a/app/src/integrationTest/java/dev/mieser/tsa/nativetest/NativeApplicationSmokeTest.java +++ b/app/src/native-test/java/dev/mieser/tsa/nativetest/NativeApplicationSmokeTest.java @@ -78,7 +78,7 @@ private TimeStampResponseData signRequestViaHttpEndpoint() throws Exception { .extract() .as(new TypeRef>() {}) .content() - .get(0); + .getFirst(); } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e644113..a4b76b9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23..0aaefbc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30d..9d21a21 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/settings.gradle.kts b/settings.gradle.kts index 1f1a88b..2fc70f4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,21 +6,21 @@ include("web") dependencyResolutionManagement { versionCatalogs { create("libs") { - version("quarkus", "3.11.0") - version("mapstruct", "1.5.5.Final") + version("quarkus", "3.15.0") + version("mapstruct", "1.6.2") plugin("quarkus", "io.quarkus").versionRef("quarkus") - plugin("lombok", "io.freefair.lombok").version("8.6") + plugin("lombok", "io.freefair.lombok").version("8.10") plugin("spotless", "com.diffplug.spotless").version("6.25.0") library("quarkus-bom", "io.quarkus", "quarkus-bom").versionRef("quarkus") - library("bouncycastle", "org.bouncycastle:bcpkix-jdk18on:1.78.1") + library("bouncycastle", "org.bouncycastle", "bcpkix-jdk18on").version("1.78.1") library("mapstruct-processor", "org.mapstruct", "mapstruct-processor").versionRef("mapstruct") library("mapstruct-runtime", "org.mapstruct", "mapstruct").versionRef("mapstruct") } create("testLibs") { - library("assertj", "org.assertj:assertj-core:3.26.0") + library("assertj", "org.assertj:assertj-core:3.26.3") library("archunit", "com.tngtech.archunit:archunit:1.3.0") } }