diff --git a/docker-compose.yml b/docker-compose.yml index 80639f6..9dd5954 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,7 @@ -version: "3.8" services: db: container_name: db - image: postgres:14.4 + image: postgres:18.1 restart: always environment: - POSTGRES_DB=postgres @@ -13,7 +12,7 @@ services: wiremock: container_name: wiremock - image: wiremock/wiremock:3.0.0-1 + image: wiremock/wiremock:3.13.2 ports: - "8888:8080" command: [ "--async-response-enabled=true", "--no-request-journal" ] diff --git a/dropwizard-app/build.gradle b/dropwizard-app/build.gradle index 1046bb2..a2b400b 100644 --- a/dropwizard-app/build.gradle +++ b/dropwizard-app/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'application' - id 'com.github.johnrengelman.shadow' version '8.1.1' + id 'com.gradleup.shadow' version '9.2.1' } group = 'bitxon.dropwizard' @@ -18,45 +18,47 @@ repositories { } dependencies { - implementation project(":common-api") - implementation enforcedPlatform("io.dropwizard:dropwizard-bom:4.0.12") + implementation project(':common-api') + implementation enforcedPlatform('io.dropwizard:dropwizard-bom:5.0.0') implementation 'io.dropwizard:dropwizard-core' implementation 'io.dropwizard:dropwizard-client' implementation 'io.dropwizard:dropwizard-validation' implementation 'io.dropwizard:dropwizard-hibernate' - implementation 'org.mapstruct:mapstruct:1.5.3.Final' + implementation 'org.mapstruct:mapstruct:1.6.3' - annotationProcessor 'org.projectlombok:lombok:1.18.36' - annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final' + annotationProcessor 'org.projectlombok:lombok:1.18.42' + annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3' - compileOnly 'org.projectlombok:lombok:1.18.36' + compileOnly 'org.projectlombok:lombok:1.18.42' - runtimeOnly 'org.postgresql:postgresql:42.7.5' + runtimeOnly 'org.postgresql:postgresql:42.7.8' testImplementation 'io.dropwizard:dropwizard-testing' - testImplementation project(":common-wiremock") - testImplementation 'org.wiremock:wiremock:3.2.0' - testImplementation 'com.google.code.findbugs:jsr305:3.0.2' //TODO research - dep should be transitive from wiremock - testImplementation 'org.testcontainers:testcontainers:1.20.4' - testImplementation 'org.testcontainers:junit-jupiter:1.20.4' - testImplementation 'org.testcontainers:postgresql:1.20.4' - testImplementation 'org.assertj:assertj-core:3.27.3' - testImplementation 'io.rest-assured:rest-assured:5.5.0' - testImplementation 'org.junit.jupiter:junit-jupiter-api' + testImplementation project(':common-wiremock') + testImplementation platform('org.testcontainers:testcontainers-bom:2.0.2') + testImplementation 'org.wiremock:wiremock:3.13.2' + testImplementation 'org.testcontainers:testcontainers' + testImplementation 'org.testcontainers:testcontainers-junit-jupiter' + testImplementation 'org.testcontainers:testcontainers-postgresql' + testImplementation 'org.assertj:assertj-core:3.27.6' + testImplementation 'io.rest-assured:rest-assured:5.5.6' + testImplementation 'org.junit.jupiter:junit-jupiter' testImplementation 'org.junit.jupiter:junit-jupiter-params' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { useJUnitPlatform() } -mainClassName = 'bitxon.dropwizard.DropwizardApplication' +application { + mainClass = 'bitxon.dropwizard.DropwizardApplication' +} jar { manifest { - attributes 'Main-Class': mainClassName - attributes 'Build-Jdk-Spec': sourceCompatibility + attributes 'Main-Class': application.mainClass + attributes 'Build-Jdk-Spec': java.sourceCompatibility attributes 'Class-Path': sourceSets.main.runtimeClasspath.collect { it.name }.join(' ') } } diff --git a/dropwizard-app/src/main/java/bitxon/dropwizard/DropwizardApplication.java b/dropwizard-app/src/main/java/bitxon/dropwizard/DropwizardApplication.java index c345b51..2e2d660 100644 --- a/dropwizard-app/src/main/java/bitxon/dropwizard/DropwizardApplication.java +++ b/dropwizard-app/src/main/java/bitxon/dropwizard/DropwizardApplication.java @@ -36,6 +36,12 @@ public void initialize(final Bootstrap bootstrap) { bootstrap.setConfigurationSourceProvider(new ClasspathOrFileConfigurationSourceProvider()); bootstrap.addBundle(hibernate); + + // TODO remove when Dropwizard 5 will release a fix with proper registration of Jackson's polymorphic subtypes + bootstrap.getObjectMapper().registerSubtypes( + io.dropwizard.jetty.HttpConnectorFactory.class, + io.dropwizard.jetty.HttpsConnectorFactory.class + ); } @Override diff --git a/dropwizard-app/src/test/java/bitxon/dropwizard/test/AbstractDropwizardTest.java b/dropwizard-app/src/test/java/bitxon/dropwizard/test/AbstractDropwizardTest.java index 720cb5d..1948421 100644 --- a/dropwizard-app/src/test/java/bitxon/dropwizard/test/AbstractDropwizardTest.java +++ b/dropwizard-app/src/test/java/bitxon/dropwizard/test/AbstractDropwizardTest.java @@ -19,12 +19,12 @@ abstract class AbstractDropwizardTest { - static PostgreSQLContainer DB = (PostgreSQLContainer) new PostgreSQLContainer(DockerImageName.parse("postgres").withTag("14.4")) + static PostgreSQLContainer DB = (PostgreSQLContainer) new PostgreSQLContainer("postgres:18.1") .withDatabaseName("testdb") .withUsername("postgres") .withPassword("postgres") .withInitScript("sql/db-test-data.sql"); - static GenericContainer WIREMOCK = new GenericContainer("wiremock/wiremock:3.0.0-1") + static GenericContainer WIREMOCK = new GenericContainer("wiremock/wiremock:3.13.2") .withExposedPorts(8080) .withCopyFileToContainer(MountableFile.forClasspathResource("stubs"), "/home/wiremock") .waitingFor(Wait diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd49..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 e18bc25..23449a2 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.12.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..f3b75f3 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,7 @@ 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\n' "$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 6689b85..9b42019 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 ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/loadtest/build.gradle b/loadtest/build.gradle index 44616de..cfad8ce 100644 --- a/loadtest/build.gradle +++ b/loadtest/build.gradle @@ -1,18 +1,19 @@ plugins { id 'java' - id 'io.gatling.gradle' version '3.11.4' + id 'io.gatling.gradle' version '3.14.9' } group = 'bitxon' version = '1.0-SNAPSHOT' -sourceCompatibility = '17' -repositories { - mavenCentral() +java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } } -dependencies { - gatling +repositories { + mavenCentral() } gatling { diff --git a/loadtest/src/gatling/resources/gatling.conf b/loadtest/src/gatling/resources/gatling.conf index 127d132..5657d01 100644 --- a/loadtest/src/gatling/resources/gatling.conf +++ b/loadtest/src/gatling/resources/gatling.conf @@ -12,7 +12,7 @@ gatling { #rawFileBodiesInMemoryMaxSize = 10240 # Max bite size of raw files to be cached in memory #pebbleFileBodiesCacheMaxCapacity = 200 # Cache size for request body Pebble templates, set to 0 to disable #feederAdaptiveLoadModeThreshold = 100 # File size threshold (in MB). Below load eagerly in memory, above use batch mode with default buffer size - #shutdownTimeout = 10000 # Milliseconds to wait for the actor system to shutdown + #shutdownTimeout = 10000 # Milliseconds to wait for the engine to shutdown extract { regex { #cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching @@ -37,7 +37,7 @@ gatling { netty { #useNativeTransport = true # if Netty Linux native transport should be used instead of Java NIO #useIoUring = false # if io_uring should be used instead of epoll if available - #allocator = "pooled" # switch to unpooled for unpooled ByteBufAllocator + #allocator = "pooled" # force the ByteBufAllocator, possible values are pooled, unpooled and adaptive #maxThreadLocalCharBufferSize = 200000 # Netty's default is 16k } ssl { @@ -64,15 +64,15 @@ gatling { } } charting { - #maxPlotPerSeries = 1000 # Number of points per graph in Gatling reports + #maxPlotPerSeries = 1000 # Number of points per chart in Gatling reports #useGroupDurationMetric = false # Switch group timings from cumulated response time to group duration. indicators { #lowerBound = 800 # Lower bound for the requests' response time to track in the reports and the console summary #higherBound = 1200 # Higher bound for the requests' response time to track in the reports and the console summary - #percentile1 = 50 # Value for the 1st percentile to track in the reports, the console summary and Graphite - #percentile2 = 75 # Value for the 2nd percentile to track in the reports, the console summary and Graphite - #percentile3 = 95 # Value for the 3rd percentile to track in the reports, the console summary and Graphite - #percentile4 = 99 # Value for the 4th percentile to track in the reports, the console summary and Graphite + #percentile1 = 50 # Value for the 1st percentile to track in the reports and the console summary + #percentile2 = 75 # Value for the 2nd percentile to track in the reports and the console summary + #percentile3 = 95 # Value for the 3rd percentile to track in the reports and the console summary + #percentile4 = 99 # Value for the 4th percentile to track in the reports and the console summary } } http { @@ -82,7 +82,7 @@ gatling { #warmUpUrl = "https://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled) #pooledConnectionIdleTimeout = 60000 # Timeout in millis for a connection to stay idle in the pool #requestTimeout = 60000 # Timeout in millis for performing an HTTP request - #enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine.setHttpsEndpointIdentificationAlgorithm("HTTPS") + #enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine#setEndpointIdentificationAlgorithm("HTTPS") dns { #queryTimeout = 5000 # Timeout in millis of each DNS query in millis #maxQueriesPerResolve = 6 # Maximum allowed number of DNS queries for a given name resolution @@ -92,7 +92,7 @@ gatling { #replyTimeoutScanPeriod = 1000 # scan period for timed out reply messages } data { - #writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite) + #writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file) #utcDateTime = true # Print date-times with the UTC zone instead of the System's default console { #light = false # When set to true, displays a light version without detailed request stats diff --git a/micronaut-app/build.gradle b/micronaut-app/build.gradle index e1fa19d..8989b78 100644 --- a/micronaut-app/build.gradle +++ b/micronaut-app/build.gradle @@ -1,8 +1,8 @@ plugins { - id("com.github.johnrengelman.shadow") version "8.1.1" - id("io.micronaut.application") version "4.4.4" - id("io.micronaut.test-resources") version "4.4.4" - id("io.micronaut.aot") version "4.4.4" + id("com.gradleup.shadow") version "9.2.1" + id("io.micronaut.application") version "4.6.1" + id("io.micronaut.test-resources") version "4.6.1" + id("io.micronaut.aot") version "4.6.1" } group = 'bitxon.micronaut' @@ -24,6 +24,7 @@ dependencies { annotationProcessor("org.mapstruct:mapstruct-processor:1.5.3.Final") annotationProcessor("io.micronaut.data:micronaut-data-processor") annotationProcessor("io.micronaut:micronaut-http-validation") + annotationProcessor("io.micronaut.validation:micronaut-validation-processor") implementation("io.micronaut:micronaut-http-client") implementation("io.micronaut:micronaut-jackson-databind") implementation("io.micronaut:micronaut-management") @@ -44,7 +45,12 @@ dependencies { testImplementation("org.testcontainers:postgresql") testImplementation("org.testcontainers:testcontainers") testImplementation project(":common-wiremock") - testImplementation("org.wiremock:wiremock:3.2.0") + testImplementation("org.wiremock:wiremock:3.13.2") + testImplementation 'org.eclipse.jetty:jetty-servlet:11.0.26' // wiremock dependency conflict workaround + testImplementation 'org.eclipse.jetty:jetty-servlets:11.0.26' // wiremock dependency conflict workaround + testImplementation 'org.eclipse.jetty:jetty-webapp:11.0.26' // wiremock dependency conflict workaround + testImplementation 'org.eclipse.jetty.http2:http2-server:11.0.26' // wiremock dependency conflict workaround + testRuntimeOnly("org.junit.platform:junit-platform-launcher") } application { @@ -53,7 +59,7 @@ application { graalvmNative.toolchainDetection = false micronaut { - version("4.7.4") + version("4.10.3") runtime("netty") testRuntime("junit5") processing { @@ -74,3 +80,7 @@ micronaut { } } +tasks.named("dockerfileNative") { + jdkVersion = "21" +} + diff --git a/micronaut-app/src/test/java/bitxon/micronaut/test/AbstractMicronautTest.java b/micronaut-app/src/test/java/bitxon/micronaut/test/AbstractMicronautTest.java index ebb5bad..15cd726 100644 --- a/micronaut-app/src/test/java/bitxon/micronaut/test/AbstractMicronautTest.java +++ b/micronaut-app/src/test/java/bitxon/micronaut/test/AbstractMicronautTest.java @@ -22,12 +22,12 @@ @TestInstance(TestInstance.Lifecycle.PER_CLASS) abstract class AbstractMicronautTest implements TestPropertyProvider { - static PostgreSQLContainer DB = (PostgreSQLContainer) new PostgreSQLContainer(DockerImageName.parse("postgres").withTag("14.4")) + static PostgreSQLContainer DB = (PostgreSQLContainer) new PostgreSQLContainer("postgres:18.1") .withDatabaseName("testdb") .withUsername("postgres") .withPassword("postgres") .withInitScript("sql/db-test-data.sql"); - static GenericContainer WIREMOCK = new GenericContainer("wiremock/wiremock:3.0.0-1") + static GenericContainer WIREMOCK = new GenericContainer("wiremock/wiremock:3.13.2") .withExposedPorts(8080) .withCopyFileToContainer(MountableFile.forClasspathResource("stubs"), "/home/wiremock") .waitingFor(Wait diff --git a/quarkus-app/README.md b/quarkus-app/README.md index 1eff742..6316f54 100644 --- a/quarkus-app/README.md +++ b/quarkus-app/README.md @@ -4,7 +4,7 @@ 1. Build - `gradle clean build` (Slim jar) - - `gradle clean build -Dquarkus.package.type=uber-jar` (Fat Jar) + - `gradle clean build -Dquarkus.package.jar.type=uber-jar` (Fat Jar) 2. Start application - `java -jar quarkus-app/build/quarkus-app/quarkus-run.jar` (Slim jar) - `java -jar quarkus-app/build/quarkus-app-1.0-SNAPSHOT-runner.jar` (Fat Jar) @@ -25,12 +25,12 @@ You can create a native executable using: ```shell script -./gradlew build -Dquarkus.package.type=native +gradle build -Dquarkus.native.enabled=true -Dquarkus.package.jar.enabled=false ``` Or, if you don't have GraalVM installed, you can run the native executable build in a container using: ```shell script -./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true +gradle build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true -Dquarkus.package.jar.enabled=false ``` You can then execute your native executable with: `./build/quarkus-app-1.0-SNAPSHOT-runner` diff --git a/quarkus-app/build.gradle b/quarkus-app/build.gradle index 3c9c5a1..e56a924 100644 --- a/quarkus-app/build.gradle +++ b/quarkus-app/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'io.quarkus' version '3.17.8' + id 'io.quarkus' version '3.30.1' } ext.set("quarkus.package.jar.type", "uber-jar") // ['fast-jar', 'uber-jar', 'mutable-jar'] @@ -23,7 +23,7 @@ dependencies { annotationProcessor 'org.projectlombok:lombok:1.18.36' annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final' implementation project(":common-api") - implementation enforcedPlatform("io.quarkus.platform:quarkus-bom:3.17.8") + implementation enforcedPlatform("io.quarkus.platform:quarkus-bom:3.30.1") implementation 'io.quarkus:quarkus-arc' implementation 'io.quarkus:quarkus-rest-jackson' implementation 'io.quarkus:quarkus-rest-client-jackson' @@ -38,12 +38,13 @@ dependencies { testImplementation 'org.testcontainers:junit-jupiter' testImplementation 'org.testcontainers:postgresql' testImplementation 'org.testcontainers:testcontainers' - testImplementation 'org.wiremock:wiremock:3.2.0' + testImplementation 'org.wiremock:wiremock:3.13.2' testImplementation project(":common-wiremock") } test { systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager" + jvmArgs "--add-opens", "java.base/java.lang=ALL-UNNAMED" } compileJava { diff --git a/quarkus-app/src/main/docker/Dockerfile.jvm b/quarkus-app/src/main/docker/Dockerfile.jvm index 69bed8c..56972ca 100644 --- a/quarkus-app/src/main/docker/Dockerfile.jvm +++ b/quarkus-app/src/main/docker/Dockerfile.jvm @@ -26,7 +26,8 @@ # This scripts computes the command line to execute your Java application, and # includes memory/GC tuning. # You can configure the behavior using the following environment properties: -# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") - Be aware that this will override +# the default JVM options, use `JAVA_OPTS_APPEND` to append options # - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options # in JAVA_OPTS (example: "-Dsome.property=foo") # - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is @@ -77,7 +78,7 @@ # accessed directly. (example: "foo.example.com,bar.example.com") # ### -FROM registry.access.redhat.com/ubi8/openjdk-21:1.20 +FROM registry.access.redhat.com/ubi9/openjdk-21:1.23 ENV LANGUAGE='en_US:en' diff --git a/quarkus-app/src/main/docker/Dockerfile.legacy-jar b/quarkus-app/src/main/docker/Dockerfile.legacy-jar index 7aa1784..6dc2cdb 100644 --- a/quarkus-app/src/main/docker/Dockerfile.legacy-jar +++ b/quarkus-app/src/main/docker/Dockerfile.legacy-jar @@ -26,7 +26,8 @@ # This scripts computes the command line to execute your Java application, and # includes memory/GC tuning. # You can configure the behavior using the following environment properties: -# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") - Be aware that this will override +# the default JVM options, use `JAVA_OPTS_APPEND` to append options # - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options # in JAVA_OPTS (example: "-Dsome.property=foo") # - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is @@ -77,7 +78,7 @@ # accessed directly. (example: "foo.example.com,bar.example.com") # ### -FROM registry.access.redhat.com/ubi8/openjdk-21:1.20 +FROM registry.access.redhat.com/ubi9/openjdk-21:1.23 ENV LANGUAGE='en_US:en' diff --git a/quarkus-app/src/main/docker/Dockerfile.native b/quarkus-app/src/main/docker/Dockerfile.native index 5c2032e..5f8cbc5 100644 --- a/quarkus-app/src/main/docker/Dockerfile.native +++ b/quarkus-app/src/main/docker/Dockerfile.native @@ -13,13 +13,15 @@ # # docker run -i --rm -p 8080:8080 quarkus/quarkus-app # +# The ` registry.access.redhat.com/ubi9/ubi-minimal:9.6` base image is based on UBI 9. +# To use UBI 8, switch to `quay.io/ubi8/ubi-minimal:8.10`. ### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ && chown 1001:root /work -COPY --chown=1001:root build/*-runner /work/application +COPY --chown=1001:root --chmod=0755 build/*-runner /work/application EXPOSE 8080 USER 1001 diff --git a/quarkus-app/src/main/docker/Dockerfile.native-micro b/quarkus-app/src/main/docker/Dockerfile.native-micro index d881dc6..6a9f26d 100644 --- a/quarkus-app/src/main/docker/Dockerfile.native-micro +++ b/quarkus-app/src/main/docker/Dockerfile.native-micro @@ -16,13 +16,15 @@ # # docker run -i --rm -p 8080:8080 quarkus/quarkus-app # +# The `quay.io/quarkus/ubi9-quarkus-micro-image:2.0` base image is based on UBI 9. +# To use UBI 8, switch to `quay.io/quarkus/quarkus-micro-image:2.0`. ### -FROM quay.io/quarkus/quarkus-micro-image:2.0 +FROM quay.io/quarkus/ubi9-quarkus-micro-image:2.0 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ && chown 1001:root /work -COPY --chown=1001:root build/*-runner /work/application +COPY --chown=1001:root --chmod=0755 build/*-runner /work/application EXPOSE 8080 USER 1001 diff --git a/quarkus-app/src/main/resources/application.properties b/quarkus-app/src/main/resources/application.properties index f4ff32b..49068ca 100644 --- a/quarkus-app/src/main/resources/application.properties +++ b/quarkus-app/src/main/resources/application.properties @@ -5,13 +5,13 @@ quarkus.http.port=8080 # Default '200' quarkus.thread-pool.max-threads=200 -quarkus.datasource.db-kind = postgresql -quarkus.datasource.username = postgres -quarkus.datasource.password = postgres +quarkus.datasource.db-kind=postgresql +quarkus.datasource.username=postgres +quarkus.datasource.password=postgres # Default '20' -quarkus.datasource.jdbc.max-size = 40 -quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:5432/postgres -quarkus.hibernate-orm.database.generation = drop-and-create +quarkus.datasource.jdbc.max-size=40 +quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres +quarkus.hibernate-orm.schema-management.strategy=drop-and-create quarkus.rest-client.exchange-client.url=http://localhost:8888 # Default '30000' @@ -24,4 +24,4 @@ quarkus.index-dependency.common-api.group-id=bitxon.common quarkus.index-dependency.common-api.artifact-id=common-api # Profile 'test' -%test.quarkus.hibernate-orm.database.generation = none +%test.quarkus.hibernate-orm.schema-management.strategy=none diff --git a/quarkus-app/src/test/java/bitxon/quarkus/test/ext/PostgresTestResourceLifecycleManager.java b/quarkus-app/src/test/java/bitxon/quarkus/test/ext/PostgresTestResourceLifecycleManager.java index 7fcd046..6349889 100644 --- a/quarkus-app/src/test/java/bitxon/quarkus/test/ext/PostgresTestResourceLifecycleManager.java +++ b/quarkus-app/src/test/java/bitxon/quarkus/test/ext/PostgresTestResourceLifecycleManager.java @@ -13,7 +13,7 @@ public class PostgresTestResourceLifecycleManager implements QuarkusTestResource @Override public void init(Map initArgs) { - postgreSQLContainer = (PostgreSQLContainer) new PostgreSQLContainer(DockerImageName.parse("postgres").withTag("14.4")) + postgreSQLContainer = (PostgreSQLContainer) new PostgreSQLContainer("postgres:18.1") .withDatabaseName("testdb") .withUsername("postgres") .withPassword("postgres") @@ -26,9 +26,9 @@ public Map start() { return Map.of( "quarkus.datasource.jdbc.url", postgreSQLContainer.getJdbcUrl(), - "quarkus.datasource.username ", postgreSQLContainer.getUsername(), + "quarkus.datasource.username", postgreSQLContainer.getUsername(), "quarkus.datasource.password", postgreSQLContainer.getPassword(), - "quarkus.hibernate-orm.database.generation", "none" + "quarkus.hibernate-orm.schema-management.strategy", "none" ); } diff --git a/quarkus-app/src/test/java/bitxon/quarkus/test/ext/WiremockTestResourceLifecycleManager.java b/quarkus-app/src/test/java/bitxon/quarkus/test/ext/WiremockTestResourceLifecycleManager.java index 6093085..2b80bd7 100644 --- a/quarkus-app/src/test/java/bitxon/quarkus/test/ext/WiremockTestResourceLifecycleManager.java +++ b/quarkus-app/src/test/java/bitxon/quarkus/test/ext/WiremockTestResourceLifecycleManager.java @@ -18,7 +18,7 @@ public class WiremockTestResourceLifecycleManager implements QuarkusTestResource @Override public void init(Map initArgs) { - wiremockContainer = new GenericContainer("wiremock/wiremock:3.0.0-1") + wiremockContainer = new GenericContainer("wiremock/wiremock:3.13.2") .withExposedPorts(8080) .withCopyFileToContainer(MountableFile.forClasspathResource("stubs"), "/home/wiremock") .waitingFor(Wait diff --git a/spring-app/build.gradle b/spring-app/build.gradle index edc47bd..cfe3228 100644 --- a/spring-app/build.gradle +++ b/spring-app/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.4.2' + id 'org.springframework.boot' version '4.0.0' id 'io.spring.dependency-management' version '1.1.7' } @@ -25,7 +25,7 @@ repositories { dependencyManagement { imports { - mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.2' + mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2025.1.0' } } @@ -35,10 +35,10 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.mapstruct:mapstruct:1.5.3.Final' + implementation 'org.mapstruct:mapstruct:1.6.3' annotationProcessor("org.projectlombok:lombok") - annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final' + annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3' compileOnly("org.projectlombok:lombok") @@ -51,10 +51,11 @@ dependencies { testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.boot:spring-boot-testcontainers' + testImplementation 'org.springframework.cloud:spring-cloud-starter-contract-stub-runner' testImplementation project(":common-wiremock") - testImplementation 'org.wiremock:wiremock:3.2.0' - testImplementation 'org.testcontainers:postgresql' - testImplementation 'io.rest-assured:rest-assured' + testImplementation 'org.testcontainers:testcontainers-junit-jupiter' + testImplementation 'org.testcontainers:testcontainers-postgresql' + testImplementation 'io.rest-assured:rest-assured:6.0.0' } test { diff --git a/spring-app/src/test/java/bitxon/spring/test/ext/TestcontainersConfig.java b/spring-app/src/test/java/bitxon/spring/test/ext/TestcontainersConfig.java index 8d7466e..6dece81 100644 --- a/spring-app/src/test/java/bitxon/spring/test/ext/TestcontainersConfig.java +++ b/spring-app/src/test/java/bitxon/spring/test/ext/TestcontainersConfig.java @@ -23,7 +23,7 @@ public DynamicPropertyRegistrar propertiesOverride(GenericContainer wiremockCont @Bean @ServiceConnection public PostgreSQLContainer postgreSQLContainer() { - return (PostgreSQLContainer) new PostgreSQLContainer("postgres:14.4") + return (PostgreSQLContainer) new PostgreSQLContainer("postgres:18.1") .withDatabaseName("testdb") .withUsername("postgres") .withPassword("postgres") @@ -32,7 +32,7 @@ public PostgreSQLContainer postgreSQLContainer() { @Bean public GenericContainer wiremockContainer() { - return new GenericContainer("wiremock/wiremock:3.0.0-1") + return new GenericContainer("wiremock/wiremock:3.13.2") .withExposedPorts(8080) .withCopyFileToContainer(MountableFile.forClasspathResource("stubs"), "/home/wiremock") .waitingFor(Wait