From 334d2d1a0b9a10866a24caeabe306fdf26169f65 Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Wed, 9 Nov 2022 10:02:09 +0100 Subject: [PATCH 1/2] Upgrade GraalVM native image to 22.3.0 (#5308) * Introducing native image plugin from GraalVM * Support GraalVM 22.3 build * Update graalvm version in all relevant files. Signed-off-by: Tomas Langer --- .../reflect-config.json | 102 ------------------ 1 file changed, 102 deletions(-) diff --git a/tracing/jaeger/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-jaeger/reflect-config.json b/tracing/jaeger/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-jaeger/reflect-config.json index a06752f7420..c37848ea954 100644 --- a/tracing/jaeger/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-jaeger/reflect-config.json +++ b/tracing/jaeger/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-jaeger/reflect-config.json @@ -1,106 +1,4 @@ [ - { - "name": "io.jaegertracing.internal.samplers.http.SamplingStrategyResponse", - "allPublicConstructors": true, - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "allPublicFields": true, - "allDeclaredFields": true, - "fields": [ - { - "name": "probabilisticSampling", - "allowWrite": true - }, - { - "name": "rateLimitingSampling", - "allowWrite": true - }, - { - "name": "operationSampling", - "allowWrite": true - } - ] - }, - { - "name": "io.jaegertracing.internal.metrics.Metrics", - "allPublicConstructors": true, - "allPublicMethods": true, - "allPublicFields": true, - "allDeclaredFields": true - }, - { - "name": "io.jaegertracing.internal.samplers.http.ProbabilisticSamplingStrategy", - "allPublicConstructors": true, - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "allPublicFields": true, - "allDeclaredFields": true, - "fields": [ - { - "name": "samplingRate", - "allowWrite": true - } - ] - }, - { - "name": "io.jaegertracing.internal.samplers.http.RateLimitingSamplingStrategy", - "allPublicConstructors": true, - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "allPublicFields": true, - "allDeclaredFields": true, - "fields": [ - { - "name": "maxTracesPerSecond", - "allowWrite": true - } - ] - }, - { - "name": "io.jaegertracing.internal.samplers.http.PerOperationSamplingParameters", - "allPublicConstructors": true, - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "allPublicFields": true, - "allDeclaredFields": true, - "fields": [ - { - "name": "operation", - "allowWrite": true - }, - { - "name": "probabilisticSampling", - "allowWrite": true - } - ] - }, - { - "name": "io.jaegertracing.internal.samplers.http.OperationSamplingParameters", - "allPublicConstructors": true, - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "allPublicFields": true, - "allDeclaredFields": true, - "fields": [ - { - "name": "defaultSamplingProbability", - "allowWrite": true - }, - { - "name": "defaultLowerBoundTracesPerSecond", - "allowWrite": true - }, - { - "name": "perOperationStrategies", - "allowWrite": true - } - ] - }, { "name": "java.time.Instant", "methods": [ From a62b3aee36919f0ee5b71fe95e80f16e6993652c Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Fri, 11 Nov 2022 15:33:22 +0100 Subject: [PATCH 2/2] Upgrade GraalVM native image to 22.3.0 --- applications/mp/pom.xml | 16 +++- applications/pom.xml | 35 +++++++++ applications/se/pom.xml | 23 +++--- .../common/files/Dockerfile.native.mustache | 2 +- .../helidon-common/native-image.properties | 3 +- .../helidon-common/resource-config.json | 0 .../native-image/native-image.properties | 16 ---- .../native-image.properties | 5 +- dependencies/pom.xml | 7 +- docs/includes/guides/graalnative.adoc | 2 +- etc/dependency-check-suppression.xml | 34 ++++---- etc/scripts/includes/pipeline-env.sh | 2 +- .../neo4j/neo4j-mp/Dockerfile.native | 2 +- .../neo4j/neo4j-se/Dockerfile.native | 2 +- .../helidon-quickstart-mp/Dockerfile.native | 2 +- .../helidon-quickstart-mp/README.md | 2 +- .../helidon-quickstart-se/Dockerfile.native | 2 +- .../helidon-quickstart-se/README.md | 2 +- .../Dockerfile.native | 2 +- .../Dockerfile.native | 2 +- .../README.md | 2 +- .../helidon-grpc-core/native-image.properties | 3 +- .../native-image.properties | 6 +- .../native-image.properties | 8 +- .../native-image.properties | 2 +- .../resource-config.json | 0 .../native-image.properties | 6 +- integrations/db/h2/pom.xml | 4 +- .../ojdbc/jni-config.json | 6 -- .../ojdbc/native-image.properties | 39 ---------- .../ojdbc/reflect-config.json | 78 ------------------- .../ojdbc/resource-config.json | 15 ---- integrations/db/pgsql/pom.xml | 4 +- .../graal/mp-native-image-extension/pom.xml | 5 -- .../mp/nativeimage/extension/WeldFeature.java | 4 +- .../src/main/java/module-info.java | 1 - .../graal/native-image-extension/pom.xml | 5 -- .../extension/HelidonReflectionFeature.java | 15 ++-- .../src/main/java/module-info.java | 1 - .../native-image.properties | 2 +- .../reflect-config.json | 0 .../resource-config.json | 0 .../native-image.properties | 0 .../reflect-config.json | 0 .../native-image.properties | 1 - .../native-image.properties | 0 .../helidon-media-jsonp}/reflect-config.json | 0 messaging/connectors/kafka/pom.xml | 4 +- .../kafka/src/main/java/module-info.java | 2 +- .../native-image.properties | 2 +- .../native-image.properties | 13 ++-- .../helidon-openapi/native-image.properties | 5 +- .../native-image.properties | 1 + .../native-image.properties | 0 .../resource-config.json | 0 .../native-image.properties | 0 .../reflect-config.json | 0 .../helidon/reactive/webclient/WebClient.java | 11 +++ .../reflect-config.json | 7 -- .../native-image.properties | 3 +- .../native-image.properties | 0 .../reflect-config.json | 0 .../native-image.properties | 3 +- .../helidon-security/native-image.properties | 11 +-- tests/integration/native-image/mp-1/README.md | 1 - tests/integration/native-image/mp-1/pom.xml | 7 ++ tests/integration/native-image/mp-2/README.md | 2 +- tests/integration/native-image/mp-2/pom.xml | 32 ++------ .../tests/mp-2/native-image.properties | 20 ----- tests/integration/native-image/mp-3/pom.xml | 7 ++ .../META-INF/microprofile-config.properties | 1 - .../nativeimage/nima1/WebClientService.java | 2 +- tests/integration/native-image/se-1/pom.xml | 7 ++ .../nativeimage/se1/MockZipkinService.java | 3 +- .../nativeimage/se1/WebClientService.java | 4 +- .../native-image.properties | 3 +- .../native-image.properties | 2 +- .../native-image.properties | 5 ++ .../reflect-config.json | 0 79 files changed, 195 insertions(+), 331 deletions(-) rename common/common/src/main/resources/META-INF/native-image/{io.helidon => io.helidon.common}/helidon-common/native-image.properties (84%) rename common/common/src/main/resources/META-INF/native-image/{io.helidon => io.helidon.common}/helidon-common/resource-config.json (100%) delete mode 100644 config/encryption/src/main/resources/META-INF/native-image/native-image.properties rename integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/{io.helidon.integrations.cd => io.helidon.integrations.cdi}/helidon-integrations-cdi-jpa/native-image.properties (92%) rename integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/{io.helidon.integrations.cd => io.helidon.integrations.cdi}/helidon-integrations-cdi-jpa/resource-config.json (100%) delete mode 100644 integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/jni-config.json delete mode 100644 integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/native-image.properties delete mode 100644 integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/resource-config.json rename integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/{io.helidon/helidon => io.helidon.integrations.graal/helidon-graal-native-image-extension}/native-image.properties (95%) rename integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/{io.helidon/helidon => io.helidon.integrations.graal/helidon-graal-native-image-extension}/reflect-config.json (100%) rename integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/{io.helidon/helidon => io.helidon.integrations.graal/helidon-graal-native-image-extension}/resource-config.json (100%) rename jersey/jsonp/src/main/resources/META-INF/native-image/{io.helidon.jersey.media.jsonp => io.helidon.jersey}/helidon-jersey-media-jsonp/native-image.properties (100%) rename jersey/jsonp/src/main/resources/META-INF/native-image/{io.helidon.jersey.media.jsonp => io.helidon.jersey}/helidon-jersey-media-jsonp/reflect-config.json (100%) rename {nima/http/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.nima.http.media/helidon-nima-http-media-jsonp => media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp}/native-image.properties (100%) rename {nima/http/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.nima.http.media/helidon-nima-http-media-jsonp => media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp}/reflect-config.json (100%) rename metrics/metrics/src/main/resources/META-INF/native-image/io.helidon.metrics/{ => helidon-metrics}/native-image.properties (91%) rename reactive/media/jsonb/src/main/resources/META-INF/native-image/{io.helidon.media/helidon-meida-jsonb => io.helidon.reactive.media/helidon-reactive-media-jsonb}/native-image.properties (100%) rename reactive/media/jsonb/src/main/resources/META-INF/native-image/{io.helidon.media/helidon-meida-jsonb => io.helidon.reactive.media/helidon-reactive-media-jsonb}/resource-config.json (100%) rename reactive/media/jsonp/src/main/resources/META-INF/native-image/{io.helidon.media/helidon-media-jsonp-common => io.helidon.reactive.media/helidon-reactive-media-jsonp}/native-image.properties (100%) rename reactive/media/jsonp/src/main/resources/META-INF/native-image/{io.helidon.media/helidon-media-jsonp-common => io.helidon.reactive.media/helidon-reactive-media-jsonp}/reflect-config.json (100%) delete mode 100644 reactive/webserver/access-log/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver-access-log/reflect-config.json rename reactive/webserver/webserver/src/main/resources/META-INF/native-image/{io.helidon.webserver/helidon-webserver => io.helidon.reactive.webserver/helidon-reactive-webserver}/native-image.properties (100%) rename reactive/webserver/webserver/src/main/resources/META-INF/native-image/{io.helidon.webserver/helidon-webserver => io.helidon.reactive.webserver/helidon-reactive-webserver}/reflect-config.json (100%) rename security/providers/oidc-common/src/main/resources/META-INF/native-image/{ => io.helidon.security.providers/helidon-security-providers-oidc-common}/native-image.properties (87%) delete mode 100644 tests/integration/native-image/mp-2/src/main/resources/META-INF/native-image/tests/mp-2/native-image.properties rename tracing/zipkin/src/main/resources/META-INF/native-image/{ => io.helidon.tracing/helidon-tracing-zipkin}/native-image.properties (93%) rename {reactive/webclient/jaxrs/src/main/resources/META-INF/native-image => webclient/jaxrs/src/main/resources/META-INF/native-image/io.helidon.webclient/helidon-webclient-jaxrs}/native-image.properties (67%) rename reactive/webclient/jaxrs/src/main/resources/META-INF/native-image/helidon-webclient-jaxrs-reflection-config.json => webclient/jaxrs/src/main/resources/META-INF/native-image/io.helidon.webclient/helidon-webclient-jaxrs/reflect-config.json (100%) diff --git a/applications/mp/pom.xml b/applications/mp/pom.xml index db4f079f344..ee1e9ff4d1d 100644 --- a/applications/mp/pom.xml +++ b/applications/mp/pom.xml @@ -83,14 +83,22 @@ - io.helidon.build-tools - helidon-maven-plugin + org.graalvm.buildtools + native-maven-plugin - native-image + resource-config + + generateResourceConfig + + package + + + build-native-image - native-image + compile + package diff --git a/applications/pom.xml b/applications/pom.xml index afe19d1c9ca..f0bb736d796 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -50,6 +50,7 @@ 3.0.0 3.0.0 3.0.2 + 0.9.16 1.5.0.Final 0.6.1 2.7 @@ -179,6 +180,40 @@ io.grpc:protoc-gen-grpc-java:${version.lib.grpc}:exe:${os.detected.classifier} + + org.graalvm.buildtools + native-maven-plugin + ${version.plugin.nativeimage} + + + resource-config + + + true + + + + build-native-image + + + true + + ${project.build.outputDirectory} + ${project.build.finalName} + false + + false + + + + --add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.configure=ALL-UNNAMED + --enable-preview + + + + + diff --git a/applications/se/pom.xml b/applications/se/pom.xml index 5c4f9ba65a7..5a86cc2b18b 100644 --- a/applications/se/pom.xml +++ b/applications/se/pom.xml @@ -36,21 +36,22 @@ - io.helidon.build-tools - helidon-maven-plugin - - - -J--enable-preview - -J--add-modules - -JALL-SYSTEM - - + org.graalvm.buildtools + native-maven-plugin - native-image + resource-config + + generateResourceConfig + + package + + + build-native-image - native-image + compile + package diff --git a/archetypes/helidon/src/main/archetype/common/files/Dockerfile.native.mustache b/archetypes/helidon/src/main/archetype/common/files/Dockerfile.native.mustache index 4846986fd2c..eb27cc0281c 100644 --- a/archetypes/helidon/src/main/archetype/common/files/Dockerfile.native.mustache +++ b/archetypes/helidon/src/main/archetype/common/files/Dockerfile.native.mustache @@ -1,6 +1,6 @@ # 1st stage, build the app -FROM ghcr.io/graalvm/graalvm-ce:java17-21.3.0 as build +FROM ghcr.io/graalvm/graalvm-ce:ol9-java19-22.3.0 as build # Install native-image RUN gu install native-image diff --git a/common/common/src/main/resources/META-INF/native-image/io.helidon/helidon-common/native-image.properties b/common/common/src/main/resources/META-INF/native-image/io.helidon.common/helidon-common/native-image.properties similarity index 84% rename from common/common/src/main/resources/META-INF/native-image/io.helidon/helidon-common/native-image.properties rename to common/common/src/main/resources/META-INF/native-image/io.helidon.common/helidon-common/native-image.properties index 90fc3732c31..059f9251bf4 100644 --- a/common/common/src/main/resources/META-INF/native-image/io.helidon/helidon-common/native-image.properties +++ b/common/common/src/main/resources/META-INF/native-image/io.helidon.common/helidon-common/native-image.properties @@ -14,6 +14,5 @@ # limitations under the License. # -# All Helidon modules are designed to be initialized at build time -# (specific classes may be delayed to runtime) +# all Helidon classes should be designed for native image, exceptions configured in specific modules Args=--initialize-at-build-time=io.helidon diff --git a/common/common/src/main/resources/META-INF/native-image/io.helidon/helidon-common/resource-config.json b/common/common/src/main/resources/META-INF/native-image/io.helidon.common/helidon-common/resource-config.json similarity index 100% rename from common/common/src/main/resources/META-INF/native-image/io.helidon/helidon-common/resource-config.json rename to common/common/src/main/resources/META-INF/native-image/io.helidon.common/helidon-common/resource-config.json diff --git a/config/encryption/src/main/resources/META-INF/native-image/native-image.properties b/config/encryption/src/main/resources/META-INF/native-image/native-image.properties deleted file mode 100644 index 84549270225..00000000000 --- a/config/encryption/src/main/resources/META-INF/native-image/native-image.properties +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -Args=--enable-all-security-services diff --git a/config/yaml/src/main/resources/META-INF/native-image/io.helidon.config/helidon-config-yaml/native-image.properties b/config/yaml/src/main/resources/META-INF/native-image/io.helidon.config/helidon-config-yaml/native-image.properties index 4a4ca04f076..30aecd85516 100644 --- a/config/yaml/src/main/resources/META-INF/native-image/io.helidon.config/helidon-config-yaml/native-image.properties +++ b/config/yaml/src/main/resources/META-INF/native-image/io.helidon.config/helidon-config-yaml/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,4 +14,5 @@ # limitations under the License. # -Args=--initialize-at-build-time=io.helidon.config.yaml +Args=--initialize-at-build-time=io.helidon.config.yaml \ + --initialize-at-build-time=org.yaml.snakeyaml diff --git a/dependencies/pom.xml b/dependencies/pom.xml index d0fe5575a9e..b2f24f2a920 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -52,7 +52,7 @@ 1.33.3 2.3.3 3.21.7 - 21.3.0 + 22.3.0 17.4 17.1 2.9.0 @@ -978,11 +978,6 @@ - - org.graalvm.nativeimage - svm - ${version.lib.graalvm} - org.apache.kafka diff --git a/docs/includes/guides/graalnative.adoc b/docs/includes/guides/graalnative.adoc index 8bee202bc37..2d8116fe612 100644 --- a/docs/includes/guides/graalnative.adoc +++ b/docs/includes/guides/graalnative.adoc @@ -42,7 +42,7 @@ set the `GRAALVM_HOME` environment variable to point at your GraalVM installatio [source,bash] ---- # Your path might be different -export GRAALVM_HOME=/usr/local/graalvm-ce-21.3.0/Contents/Home/ +export GRAALVM_HOME=/usr/local/graalvm-ce-22.3.0/Contents/Home/ ---- Then install the optional `native-image` command: diff --git a/etc/dependency-check-suppression.xml b/etc/dependency-check-suppression.xml index ce3732b7ae9..32171512391 100644 --- a/etc/dependency-check-suppression.xml +++ b/etc/dependency-check-suppression.xml @@ -18,119 +18,119 @@ --> ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21248 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21271 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21277 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21282 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21283 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21291 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21293 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21294 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21296 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21299 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21305 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21340 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21341 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21349 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21360 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21365 ^pkg:maven/org\.graalvm\..*/.*@.*$ CVE-2022-21366 diff --git a/etc/scripts/includes/pipeline-env.sh b/etc/scripts/includes/pipeline-env.sh index be39a5ed37c..3ee715af232 100644 --- a/etc/scripts/includes/pipeline-env.sh +++ b/etc/scripts/includes/pipeline-env.sh @@ -47,7 +47,7 @@ if [ -z "${__PIPELINE_ENV_INCLUDED__}" ]; then . ${WS_DIR}/etc/scripts/includes/error_handlers.sh if [ -z "${GRAALVM_HOME}" ]; then - export GRAALVM_HOME="/tools/graal-19-23" + export GRAALVM_HOME="/tools/graalvm-ce-java19-22.3.0" fi require_env() { diff --git a/examples/integrations/neo4j/neo4j-mp/Dockerfile.native b/examples/integrations/neo4j/neo4j-mp/Dockerfile.native index b189c0e8369..8b4b5a9f63e 100644 --- a/examples/integrations/neo4j/neo4j-mp/Dockerfile.native +++ b/examples/integrations/neo4j/neo4j-mp/Dockerfile.native @@ -15,7 +15,7 @@ # # 1st stage, build the app -FROM ghcr.io/graalvm/graalvm-ce:java17-21.3.0 as build +FROM ghcr.io/graalvm/graalvm-ce:ol9-java19-22.3.0 as build # Install native-image RUN gu install native-image diff --git a/examples/integrations/neo4j/neo4j-se/Dockerfile.native b/examples/integrations/neo4j/neo4j-se/Dockerfile.native index 770f0acf859..cec6ac66574 100644 --- a/examples/integrations/neo4j/neo4j-se/Dockerfile.native +++ b/examples/integrations/neo4j/neo4j-se/Dockerfile.native @@ -15,7 +15,7 @@ # # 1st stage, build the app -FROM ghcr.io/graalvm/graalvm-ce:java17-21.3.0 as build +FROM ghcr.io/graalvm/graalvm-ce:ol9-java19-22.3.0 as build # Install native-image RUN gu install native-image diff --git a/examples/quickstarts/helidon-quickstart-mp/Dockerfile.native b/examples/quickstarts/helidon-quickstart-mp/Dockerfile.native index 4d44834f29f..c4470c1d57c 100644 --- a/examples/quickstarts/helidon-quickstart-mp/Dockerfile.native +++ b/examples/quickstarts/helidon-quickstart-mp/Dockerfile.native @@ -15,7 +15,7 @@ # # 1st stage, build the app -FROM ghcr.io/graalvm/graalvm-ce:java17-21.3.0 as build +FROM ghcr.io/graalvm/graalvm-ce:ol9-java19-22.3.0 as build # Install native-image RUN gu install native-image diff --git a/examples/quickstarts/helidon-quickstart-mp/README.md b/examples/quickstarts/helidon-quickstart-mp/README.md index 8305c86335b..4a025bd51e0 100644 --- a/examples/quickstarts/helidon-quickstart-mp/README.md +++ b/examples/quickstarts/helidon-quickstart-mp/README.md @@ -80,7 +80,7 @@ You can build a native executable in 2 different ways: ### Local build Download Graal VM at https://www.graalvm.org/downloads. We recommend -version `21.3.0` or later. +version `22.3.0` or later. ``` # Setup the environment diff --git a/examples/quickstarts/helidon-quickstart-se/Dockerfile.native b/examples/quickstarts/helidon-quickstart-se/Dockerfile.native index e6222cb4294..de40ef33a52 100644 --- a/examples/quickstarts/helidon-quickstart-se/Dockerfile.native +++ b/examples/quickstarts/helidon-quickstart-se/Dockerfile.native @@ -15,7 +15,7 @@ # # 1st stage, build the app -FROM ghcr.io/graalvm/graalvm-ce:java17-21.3.0 as build +FROM ghcr.io/graalvm/graalvm-ce:ol9-java19-22.3.0 as build # Install native-image RUN gu install native-image diff --git a/examples/quickstarts/helidon-quickstart-se/README.md b/examples/quickstarts/helidon-quickstart-se/README.md index 183fb28eced..c3da9e6d54c 100644 --- a/examples/quickstarts/helidon-quickstart-se/README.md +++ b/examples/quickstarts/helidon-quickstart-se/README.md @@ -80,7 +80,7 @@ You can build a native executable in 2 different ways: ### Local build Download Graal VM at https://www.graalvm.org/downloads. We recommend -version `21.3.0` or later. +version `22.3.0` or later. ``` # Setup the environment diff --git a/examples/quickstarts/helidon-standalone-quickstart-mp/Dockerfile.native b/examples/quickstarts/helidon-standalone-quickstart-mp/Dockerfile.native index c61e11abcea..0cfa3515179 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-mp/Dockerfile.native +++ b/examples/quickstarts/helidon-standalone-quickstart-mp/Dockerfile.native @@ -15,7 +15,7 @@ # # 1st stage, build the app -FROM ghcr.io/graalvm/graalvm-ce:java17-21.3.0 as build +FROM ghcr.io/graalvm/graalvm-ce:ol9-java19-22.3.0 as build # Install native-image RUN gu install native-image diff --git a/examples/quickstarts/helidon-standalone-quickstart-se/Dockerfile.native b/examples/quickstarts/helidon-standalone-quickstart-se/Dockerfile.native index 229b28b84d6..46000ec91f8 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-se/Dockerfile.native +++ b/examples/quickstarts/helidon-standalone-quickstart-se/Dockerfile.native @@ -15,7 +15,7 @@ # # 1st stage, build the app -FROM ghcr.io/graalvm/graalvm-ce:java17-21.3.0 as build +FROM ghcr.io/graalvm/graalvm-ce:ol9-java19-22.3.0 as build # Install native-image RUN gu install native-image diff --git a/examples/quickstarts/helidon-standalone-quickstart-se/README.md b/examples/quickstarts/helidon-standalone-quickstart-se/README.md index 05b912e03d5..08887994d89 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-se/README.md +++ b/examples/quickstarts/helidon-standalone-quickstart-se/README.md @@ -81,7 +81,7 @@ You can build a native executable in 2 different ways: ### Local build Download Graal VM at https://www.graalvm.org/downloads. We recommend -version `21.3.0` or later. +version `22.3.0` or later. ``` # Setup the environment diff --git a/grpc/core/src/main/resources/META-INF/native-image/io-helidon-grpc/helidon-grpc-core/native-image.properties b/grpc/core/src/main/resources/META-INF/native-image/io-helidon-grpc/helidon-grpc-core/native-image.properties index b64704ec106..557a30ffa17 100644 --- a/grpc/core/src/main/resources/META-INF/native-image/io-helidon-grpc/helidon-grpc-core/native-image.properties +++ b/grpc/core/src/main/resources/META-INF/native-image/io-helidon-grpc/helidon-grpc-core/native-image.properties @@ -22,5 +22,4 @@ Args=--initialize-at-build-time=com.google \ --initialize-at-run-time=io.grpc.netty.Utils$ByteBufAllocatorPreferDirectHolder \ --initialize-at-run-time=io.grpc.netty.Utils$ByteBufAllocatorPreferHeapHolder \ --initialize-at-run-time=io.helidon.grpc.core.JsonbMarshaller \ - --initialize-at-run-time=io.helidon.grpc.server.SSLContextBuilder \ - --allow-incomplete-classpath + --initialize-at-run-time=io.helidon.grpc.server.SSLContextBuilder diff --git a/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/native-image.properties b/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/native-image.properties index ce6dd8f7b41..5901aa4594b 100644 --- a/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/native-image.properties +++ b/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Oracle and/or its affiliates. +# Copyright (c) 2020, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ # limitations under the License. # -Args=--initialize-at-run-time=com.zaxxer.hikari.metrics.dropwizard.CodaHaleMetricsTracker +Args=--initialize-at-build-time=com.zaxxer.hikari \ + --initialize-at-build-time=org.slf4j \ + --initialize-at-run-time=com.zaxxer.hikari.metrics.dropwizard.CodaHaleMetricsTracker diff --git a/integrations/cdi/hibernate-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-hibernate/native-image.properties b/integrations/cdi/hibernate-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-hibernate/native-image.properties index f1dab2d9b70..8f9df8f56ce 100644 --- a/integrations/cdi/hibernate-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-hibernate/native-image.properties +++ b/integrations/cdi/hibernate-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-hibernate/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Oracle and/or its affiliates. +# Copyright (c) 2020, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ # limitations under the License. # -Args=--initialize-at-run-time=org.hibernate.secure.internal.StandardJaccServiceImpl \ - --initialize-at-run-time=org.hibernate.dialect.OracleTypesHelper +Args=--initialize-at-build-time=org.hibernate \ + --initialize-at-build-time=org.antlr \ + --initialize-at-run-time=org.hibernate.secure.internal.StandardJaccServiceImpl \ + --initialize-at-run-time=org.hibernate.dialect diff --git a/integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cd/helidon-integrations-cdi-jpa/native-image.properties b/integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jpa/native-image.properties similarity index 92% rename from integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cd/helidon-integrations-cdi-jpa/native-image.properties rename to integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jpa/native-image.properties index a90c4e40123..d9eb58f5af5 100644 --- a/integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cd/helidon-integrations-cdi-jpa/native-image.properties +++ b/integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jpa/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Oracle and/or its affiliates. +# Copyright (c) 2020, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cd/helidon-integrations-cdi-jpa/resource-config.json b/integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jpa/resource-config.json similarity index 100% rename from integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cd/helidon-integrations-cdi-jpa/resource-config.json rename to integrations/cdi/jpa-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jpa/resource-config.json diff --git a/integrations/cdi/jta-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jta/native-image.properties b/integrations/cdi/jta-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jta/native-image.properties index c66561f3a6e..9f03a961a9d 100644 --- a/integrations/cdi/jta-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jta/native-image.properties +++ b/integrations/cdi/jta-cdi/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-jta/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Oracle and/or its affiliates. +# Copyright (c) 2020, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,4 +21,6 @@ Args=--initialize-at-run-time=com.arjuna.ats.internal.jta.transaction.arjunacore --initialize-at-run-time=com.arjuna.ats.internal.arjuna.coordinator.ReaperWorkerThread \ --initialize-at-run-time=com.arjuna.ats.arjuna.recovery.RecoveryManager \ --initialize-at-run-time=com.arjuna.ats.internal.jta.resources.arjunacore.CommitMarkableResourceRecord \ - -H:IncludeResourceBundles=io.helidon.integrations.jta.cdi.Messages + --initialize-at-run-time=com.arjuna.ats.jdbc.TransactionalDriver \ + -H:IncludeResourceBundles=io.helidon.integrations.jta.cdi.Messages \ + --initialize-at-build-time=com.arjuna diff --git a/integrations/db/h2/pom.xml b/integrations/db/h2/pom.xml index c001b32f0be..f75b8f699da 100644 --- a/integrations/db/h2/pom.xml +++ b/integrations/db/h2/pom.xml @@ -48,8 +48,8 @@ h2 - org.graalvm.nativeimage - svm + org.graalvm.sdk + graal-sdk provided diff --git a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/jni-config.json b/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/jni-config.json deleted file mode 100644 index e903501a272..00000000000 --- a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/jni-config.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "name":"java.net.InetAddress", - "methods":[{"name":"","parameterTypes":[] }] - } -] \ No newline at end of file diff --git a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/native-image.properties b/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/native-image.properties deleted file mode 100644 index de101a41b82..00000000000 --- a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/native-image.properties +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (c) 2020, 2021 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -Args= --allow-incomplete-classpath \ - --enable-all-security-services \ - --initialize-at-build-time=oracle.net.jdbc.nl.mesg.NLSR_en \ - --initialize-at-build-time=oracle.jdbc.driver.DynamicByteArray \ - --initialize-at-build-time=oracle.sql.ConverterArchive \ - --initialize-at-build-time=oracle.sql.converter.CharacterConverterJDBC \ - --initialize-at-build-time=oracle.sql.converter.CharacterConverter1Byte \ - --initialize-at-run-time=oracle.jdbc.pool.OracleDataSource \ - --initialize-at-run-time=oracle.jdbc.driver.OracleDriver \ - --initialize-at-run-time=oracle.jdbc.driver.OracleTimeoutThreadPerVM \ - --initialize-at-run-time=oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource \ - --initialize-at-run-time=oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser \ - --initialize-at-run-time=oracle.security.o5logon.O5Logon \ - --initialize-at-run-time=oracle.net.nt.TimeoutInterruptHandler \ - --initialize-at-run-time=oracle.jdbc.driver.LogicalConnection \ - --initialize-at-run-time=oracle.jdbc.driver.NoSupportHAManager \ - --initialize-at-run-time=oracle.net.nt.Clock \ - --initialize-at-run-time=oracle.net.nt.TcpMultiplexer \ - --initialize-at-run-time=oracle.net.nt.TcpMultiplexer \ - --initialize-at-run-time=oracle.net.nt.TcpMultiplexer$LazyHolder \ - --initialize-at-run-time=oracle.jdbc.driver.SQLUtil$XMLFactory \ - --initialize-at-run-time=oracle.jdbc.driver.NamedTypeAccessor$XMLFactory \ - --initialize-at-run-time=oracle.xml.util.UnicodeUtil diff --git a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/reflect-config.json b/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/reflect-config.json index 4e460f36b8f..d628de76277 100644 --- a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/reflect-config.json +++ b/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/reflect-config.json @@ -1,82 +1,4 @@ [ - { - "name": "oracle.jdbc.internal.ACProxyable", - "methods": [ - { - "name": "setACProxy", - "parameterTypes": [ - "java.lang.Object" - ] - }, - { - "name": "getACProxy", - "parameterTypes": [] - } - ] - }, - { - "name": "oracle.jdbc.driver.T4CDriverExtension", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "name": "oracle.jdbc.driver.T2CDriverExtension", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "name": "oracle.net.ano.Ano", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "name": "oracle.net.ano.AuthenticationService", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "name": "oracle.net.ano.DataIntegrityService", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "name": "oracle.net.ano.EncryptionService", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "name": "oracle.net.ano.SupervisorService", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, { "name": "java.sql.Statement[]", "allDeclaredConstructors": true, diff --git a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/resource-config.json b/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/resource-config.json deleted file mode 100644 index 8ee1aead144..00000000000 --- a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/resource-config.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "resources":[ - {"pattern":"META-INF/services/java.sql.Driver"}, - {"pattern":"oracle/sql/converter_xcharset/.*.glb$"}, - {"pattern":"oracle/jdbc/defaultConnectionProperties.properties"}, - {"pattern":"oracle/jdbc/driver/errorMap.xml"}, - {"pattern":"oracle/jdbc/defaultLoggingConfig.properties"} - ], - "bundles": [ - {"name":"oracle.net.jdbc.nl.mesg.NLSR"}, - {"name":"oracle.net.mesg.Message"} - ] -} - - diff --git a/integrations/db/pgsql/pom.xml b/integrations/db/pgsql/pom.xml index 40c74de5066..71d439ab062 100644 --- a/integrations/db/pgsql/pom.xml +++ b/integrations/db/pgsql/pom.xml @@ -41,8 +41,8 @@ provided - org.graalvm.nativeimage - svm + org.graalvm.sdk + graal-sdk provided diff --git a/integrations/graal/mp-native-image-extension/pom.xml b/integrations/graal/mp-native-image-extension/pom.xml index 82af8d72051..faf1d69a3ed 100644 --- a/integrations/graal/mp-native-image-extension/pom.xml +++ b/integrations/graal/mp-native-image-extension/pom.xml @@ -56,11 +56,6 @@ graal-sdk provided - - org.graalvm.nativeimage - svm - provided - diff --git a/integrations/graal/mp-native-image-extension/src/main/java/io/helidon/integrations/graal/mp/nativeimage/extension/WeldFeature.java b/integrations/graal/mp-native-image-extension/src/main/java/io/helidon/integrations/graal/mp/nativeimage/extension/WeldFeature.java index b0455fcd8d2..0a183a46d24 100644 --- a/integrations/graal/mp-native-image-extension/src/main/java/io/helidon/integrations/graal/mp/nativeimage/extension/WeldFeature.java +++ b/integrations/graal/mp-native-image-extension/src/main/java/io/helidon/integrations/graal/mp/nativeimage/extension/WeldFeature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021 Oracle and/or its affiliates. + * Copyright (c) 2019, 2022 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import io.helidon.integrations.graal.nativeimage.extension.NativeConfig; -import com.oracle.svm.core.annotate.AutomaticFeature; import jakarta.enterprise.inject.spi.Bean; import jakarta.json.Json; import jakarta.json.JsonArray; @@ -51,7 +50,6 @@ * An automatic feature for native-image to * register Weld specific stuff. */ -@AutomaticFeature public class WeldFeature implements Feature { private static final boolean ENABLED = NativeConfig.option("weld.enable-feature", true); private static final boolean TRACE = NativeConfig.option("weld.trace", false); diff --git a/integrations/graal/mp-native-image-extension/src/main/java/module-info.java b/integrations/graal/mp-native-image-extension/src/main/java/module-info.java index 6b7f46287fc..3a237e3134d 100644 --- a/integrations/graal/mp-native-image-extension/src/main/java/module-info.java +++ b/integrations/graal/mp-native-image-extension/src/main/java/module-info.java @@ -18,7 +18,6 @@ */ module io.helidon.graal.nativeimage.mp { requires jakarta.cdi; - requires svm; requires io.helidon.graal.nativeimage; requires jakarta.json; requires org.graalvm.sdk; diff --git a/integrations/graal/native-image-extension/pom.xml b/integrations/graal/native-image-extension/pom.xml index df43bc31edd..12576c258ce 100644 --- a/integrations/graal/native-image-extension/pom.xml +++ b/integrations/graal/native-image-extension/pom.xml @@ -54,11 +54,6 @@ graal-sdk provided - - org.graalvm.nativeimage - svm - provided - diff --git a/integrations/graal/native-image-extension/src/main/java/io/helidon/integrations/graal/nativeimage/extension/HelidonReflectionFeature.java b/integrations/graal/native-image-extension/src/main/java/io/helidon/integrations/graal/nativeimage/extension/HelidonReflectionFeature.java index 12bc3f0d4d2..0b8d4465edc 100644 --- a/integrations/graal/native-image-extension/src/main/java/io/helidon/integrations/graal/nativeimage/extension/HelidonReflectionFeature.java +++ b/integrations/graal/native-image-extension/src/main/java/io/helidon/integrations/graal/nativeimage/extension/HelidonReflectionFeature.java @@ -15,6 +15,7 @@ */ package io.helidon.integrations.graal.nativeimage.extension; +import java.io.IOException; import java.io.InputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; @@ -37,13 +38,12 @@ import io.helidon.config.mp.MpConfigProviderResolver; import io.helidon.logging.common.LogConfig; -import com.oracle.svm.core.jdk.Resources; -import com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry; import io.github.classgraph.ClassGraph; import io.github.classgraph.ScanResult; -import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.hosted.Feature; +import org.graalvm.nativeimage.hosted.RuntimeProxyCreation; import org.graalvm.nativeimage.hosted.RuntimeReflection; +import org.graalvm.nativeimage.hosted.RuntimeResourceAccess; /** * Feature to add reflection configuration to the image for Helidon, CDI and Jersey. @@ -280,7 +280,11 @@ private void processEntity(BeforeAnalysisContext context) { tracer.parsing(() -> "Processing annotated class " + aClass.getName()); String resourceName = aClass.getName().replace('.', '/') + ".class"; InputStream resourceStream = aClass.getClassLoader().getResourceAsStream(resourceName); - Resources.registerResource(resourceName, resourceStream); + try { + RuntimeResourceAccess.addResource(aClass.getModule(), resourceName, resourceStream.readAllBytes()); + } catch (IOException e) { + throw new RuntimeException("Failed to read entity class file", e); + } for (Field declaredField : aClass.getDeclaredFields()) { if (!Modifier.isPublic(declaredField.getModifiers()) && declaredField.getAnnotations().length == 0) { RuntimeReflection.register(declaredField); @@ -303,7 +307,6 @@ private void processRegisterRestClient(BeforeAnalysisContext context) { tracer.parsing(() -> "Looking up annotated by " + AT_REGISTER_REST_CLIENT); Set> annotatedSet = util.findAnnotated(AT_REGISTER_REST_CLIENT); - DynamicProxyRegistry proxyRegistry = ImageSingletons.lookup(DynamicProxyRegistry.class); Class autoCloseable = context.access().findClassByName("java.lang.AutoCloseable"); Class closeable = context.access().findClassByName("java.io.Closeable"); @@ -315,7 +318,7 @@ private void processRegisterRestClient(BeforeAnalysisContext context) { processClassHierarchy(context, it); // and we also need to create a proxy tracer.parsing(() -> "Registering a proxy for class " + it.getName()); - proxyRegistry.addProxyClass(it, autoCloseable, closeable); + RuntimeProxyCreation.register(it, autoCloseable, closeable); } }); } diff --git a/integrations/graal/native-image-extension/src/main/java/module-info.java b/integrations/graal/native-image-extension/src/main/java/module-info.java index 62fc60ca24e..64d69485941 100644 --- a/integrations/graal/native-image-extension/src/main/java/module-info.java +++ b/integrations/graal/native-image-extension/src/main/java/module-info.java @@ -22,7 +22,6 @@ requires io.helidon.logging.jul; requires io.github.classgraph; requires io.helidon.config.mp; - requires svm; requires org.graalvm.sdk; requires jakarta.json; diff --git a/integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon/helidon/native-image.properties b/integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-graal-native-image-extension/native-image.properties similarity index 95% rename from integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon/helidon/native-image.properties rename to integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-graal-native-image-extension/native-image.properties index fec0100d107..fc13fba03fd 100644 --- a/integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon/helidon/native-image.properties +++ b/integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-graal-native-image-extension/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon/helidon/reflect-config.json b/integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-graal-native-image-extension/reflect-config.json similarity index 100% rename from integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon/helidon/reflect-config.json rename to integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-graal-native-image-extension/reflect-config.json diff --git a/integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon/helidon/resource-config.json b/integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-graal-native-image-extension/resource-config.json similarity index 100% rename from integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon/helidon/resource-config.json rename to integrations/graal/native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-graal-native-image-extension/resource-config.json diff --git a/jersey/jsonp/src/main/resources/META-INF/native-image/io.helidon.jersey.media.jsonp/helidon-jersey-media-jsonp/native-image.properties b/jersey/jsonp/src/main/resources/META-INF/native-image/io.helidon.jersey/helidon-jersey-media-jsonp/native-image.properties similarity index 100% rename from jersey/jsonp/src/main/resources/META-INF/native-image/io.helidon.jersey.media.jsonp/helidon-jersey-media-jsonp/native-image.properties rename to jersey/jsonp/src/main/resources/META-INF/native-image/io.helidon.jersey/helidon-jersey-media-jsonp/native-image.properties diff --git a/jersey/jsonp/src/main/resources/META-INF/native-image/io.helidon.jersey.media.jsonp/helidon-jersey-media-jsonp/reflect-config.json b/jersey/jsonp/src/main/resources/META-INF/native-image/io.helidon.jersey/helidon-jersey-media-jsonp/reflect-config.json similarity index 100% rename from jersey/jsonp/src/main/resources/META-INF/native-image/io.helidon.jersey.media.jsonp/helidon-jersey-media-jsonp/reflect-config.json rename to jersey/jsonp/src/main/resources/META-INF/native-image/io.helidon.jersey/helidon-jersey-media-jsonp/reflect-config.json diff --git a/logging/log4j/src/main/resources/META-INF/native-image/io.helidon.logging/helidon-logging-log4j/native-image.properties b/logging/log4j/src/main/resources/META-INF/native-image/io.helidon.logging/helidon-logging-log4j/native-image.properties index 0480ffc97f9..dc75e1bb098 100644 --- a/logging/log4j/src/main/resources/META-INF/native-image/io.helidon.logging/helidon-logging-log4j/native-image.properties +++ b/logging/log4j/src/main/resources/META-INF/native-image/io.helidon.logging/helidon-logging-log4j/native-image.properties @@ -16,7 +16,6 @@ Args=-Dlog4j2.disable.jmx=true \ -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager \ - --allow-incomplete-classpath \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time=org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration \ --initialize-at-build-time=org.apache.logging.log4j.core.config.status.StatusConfiguration \ diff --git a/nima/http/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.nima.http.media/helidon-nima-http-media-jsonp/native-image.properties b/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp/native-image.properties similarity index 100% rename from nima/http/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.nima.http.media/helidon-nima-http-media-jsonp/native-image.properties rename to media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp/native-image.properties diff --git a/nima/http/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.nima.http.media/helidon-nima-http-media-jsonp/reflect-config.json b/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp/reflect-config.json similarity index 100% rename from nima/http/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.nima.http.media/helidon-nima-http-media-jsonp/reflect-config.json rename to media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp/reflect-config.json diff --git a/messaging/connectors/kafka/pom.xml b/messaging/connectors/kafka/pom.xml index b642d6172af..28302166c18 100644 --- a/messaging/connectors/kafka/pom.xml +++ b/messaging/connectors/kafka/pom.xml @@ -65,8 +65,8 @@ true - org.graalvm.nativeimage - svm + org.graalvm.sdk + graal-sdk provided diff --git a/messaging/connectors/kafka/src/main/java/module-info.java b/messaging/connectors/kafka/src/main/java/module-info.java index 7640dc5f74f..b0494c5edbf 100644 --- a/messaging/connectors/kafka/src/main/java/module-info.java +++ b/messaging/connectors/kafka/src/main/java/module-info.java @@ -33,7 +33,7 @@ requires io.helidon.common.configurable; requires io.helidon.messaging; requires microprofile.config.api; - requires static svm; + requires static org.graalvm.sdk; requires java.security.sasl; requires transitive org.slf4j; // To allow KerberosLoginSubstitution diff --git a/metrics/metrics/src/main/resources/META-INF/native-image/io.helidon.metrics/native-image.properties b/metrics/metrics/src/main/resources/META-INF/native-image/io.helidon.metrics/helidon-metrics/native-image.properties similarity index 91% rename from metrics/metrics/src/main/resources/META-INF/native-image/io.helidon.metrics/native-image.properties rename to metrics/metrics/src/main/resources/META-INF/native-image/io.helidon.metrics/helidon-metrics/native-image.properties index 1c4245a3d37..4a39f5603d9 100644 --- a/metrics/metrics/src/main/resources/META-INF/native-image/io.helidon.metrics/native-image.properties +++ b/metrics/metrics/src/main/resources/META-INF/native-image/io.helidon.metrics/helidon-metrics/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Oracle and/or its affiliates. +# Copyright (c) 2021, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/microprofile/cdi/src/main/resources/META-INF/native-image/io.helidon.microprofile.cdi/helidon-microprofile-cdi/native-image.properties b/microprofile/cdi/src/main/resources/META-INF/native-image/io.helidon.microprofile.cdi/helidon-microprofile-cdi/native-image.properties index 1648ad8a7b9..37f73e723ec 100644 --- a/microprofile/cdi/src/main/resources/META-INF/native-image/io.helidon.microprofile.cdi/helidon-microprofile-cdi/native-image.properties +++ b/microprofile/cdi/src/main/resources/META-INF/native-image/io.helidon.microprofile.cdi/helidon-microprofile-cdi/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,10 +14,11 @@ # limitations under the License. # -# We need "report-unsupported-elements-at-runtime" - there is no fine grained control of this switch -Args=--initialize-at-build-time \ - --initialize-at-build-time=io.helidon.microprofile.cdi.BuildTimeInitializer \ +Args=--initialize-at-build-time=io.helidon.microprofile \ + --initialize-at-build-time=org.eclipse.microprofile \ + --initialize-at-build-time=jakarta \ + --initialize-at-build-time=org.jboss \ + --initialize-at-build-time=org.glassfish \ --initialize-at-run-time=org.jboss.weld.probe.Resource \ - --initialize-at-run-time=org.jboss.weld.probe.Resource$14 \ - --report-unsupported-elements-at-runtime + --initialize-at-run-time=org.jboss.weld.probe.Resource$14 diff --git a/openapi/src/main/resources/META-INF/native-image/io.helidon.openapi/helidon-openapi/native-image.properties b/openapi/src/main/resources/META-INF/native-image/io.helidon.openapi/helidon-openapi/native-image.properties index ce86039510f..d4458ccb1ee 100644 --- a/openapi/src/main/resources/META-INF/native-image/io.helidon.openapi/helidon-openapi/native-image.properties +++ b/openapi/src/main/resources/META-INF/native-image/io.helidon.openapi/helidon-openapi/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Oracle and/or its affiliates. +# Copyright (c) 2020, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,4 +14,5 @@ # limitations under the License. # -Args=--initialize-at-run-time=io.smallrye.openapi.runtime.io.OpenApiSerializer +Args=--initialize-at-run-time=io.smallrye.openapi.runtime.io.OpenApiSerializer \ + --initialize-at-build-time=io.smallrye.openapi diff --git a/reactive/dbclient/jdbc/src/main/resources/META-INF/native-image/io.helidon.dbclient/helidon-dbclient-jdbc/native-image.properties b/reactive/dbclient/jdbc/src/main/resources/META-INF/native-image/io.helidon.dbclient/helidon-dbclient-jdbc/native-image.properties index d504602a092..edd1cacc1f8 100644 --- a/reactive/dbclient/jdbc/src/main/resources/META-INF/native-image/io.helidon.dbclient/helidon-dbclient-jdbc/native-image.properties +++ b/reactive/dbclient/jdbc/src/main/resources/META-INF/native-image/io.helidon.dbclient/helidon-dbclient-jdbc/native-image.properties @@ -15,4 +15,5 @@ # Args= --initialize-at-build-time=org.slf4j \ + --initialize-at-build-time=com.zaxxer.hikari \ --initialize-at-run-time=com.zaxxer.hikari.metrics.dropwizard.CodaHaleMetricsTracker diff --git a/reactive/media/jsonb/src/main/resources/META-INF/native-image/io.helidon.media/helidon-meida-jsonb/native-image.properties b/reactive/media/jsonb/src/main/resources/META-INF/native-image/io.helidon.reactive.media/helidon-reactive-media-jsonb/native-image.properties similarity index 100% rename from reactive/media/jsonb/src/main/resources/META-INF/native-image/io.helidon.media/helidon-meida-jsonb/native-image.properties rename to reactive/media/jsonb/src/main/resources/META-INF/native-image/io.helidon.reactive.media/helidon-reactive-media-jsonb/native-image.properties diff --git a/reactive/media/jsonb/src/main/resources/META-INF/native-image/io.helidon.media/helidon-meida-jsonb/resource-config.json b/reactive/media/jsonb/src/main/resources/META-INF/native-image/io.helidon.reactive.media/helidon-reactive-media-jsonb/resource-config.json similarity index 100% rename from reactive/media/jsonb/src/main/resources/META-INF/native-image/io.helidon.media/helidon-meida-jsonb/resource-config.json rename to reactive/media/jsonb/src/main/resources/META-INF/native-image/io.helidon.reactive.media/helidon-reactive-media-jsonb/resource-config.json diff --git a/reactive/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp-common/native-image.properties b/reactive/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.reactive.media/helidon-reactive-media-jsonp/native-image.properties similarity index 100% rename from reactive/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp-common/native-image.properties rename to reactive/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.reactive.media/helidon-reactive-media-jsonp/native-image.properties diff --git a/reactive/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp-common/reflect-config.json b/reactive/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.reactive.media/helidon-reactive-media-jsonp/reflect-config.json similarity index 100% rename from reactive/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp-common/reflect-config.json rename to reactive/media/jsonp/src/main/resources/META-INF/native-image/io.helidon.reactive.media/helidon-reactive-media-jsonp/reflect-config.json diff --git a/reactive/webclient/webclient/src/main/java/io/helidon/reactive/webclient/WebClient.java b/reactive/webclient/webclient/src/main/java/io/helidon/reactive/webclient/WebClient.java index 86e02ec4616..ef640a2519c 100644 --- a/reactive/webclient/webclient/src/main/java/io/helidon/reactive/webclient/WebClient.java +++ b/reactive/webclient/webclient/src/main/java/io/helidon/reactive/webclient/WebClient.java @@ -367,6 +367,17 @@ public Builder addHeader(Http.HeaderName header, String... value) { return this; } + /** + * Add a default header (such as accept). + * + * @param headerValue header name and value + * @return updated builder instance + */ + public Builder addHeader(Http.HeaderValue headerValue) { + configuration.defaultHeader(headerValue); + return this; + } + /** * Sets base uri for each request. * diff --git a/reactive/webserver/access-log/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver-access-log/reflect-config.json b/reactive/webserver/access-log/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver-access-log/reflect-config.json deleted file mode 100644 index 813ae76effc..00000000000 --- a/reactive/webserver/access-log/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver-access-log/reflect-config.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "name": "io.helidon.reactive.webserver.accesslog.AccessLogHandler", - "allDeclaredConstructors": true, - "allPublicMethods": true - } -] diff --git a/reactive/webserver/jersey/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver-jersey/native-image.properties b/reactive/webserver/jersey/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver-jersey/native-image.properties index 85c430e00de..908d056c147 100644 --- a/reactive/webserver/jersey/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver-jersey/native-image.properties +++ b/reactive/webserver/jersey/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver-jersey/native-image.properties @@ -15,4 +15,5 @@ # Args=-H:EnableURLProtocols=http,https \ - --initialize-at-run-time=org.glassfish.jersey.client.internal.HttpUrlConnector + --initialize-at-run-time=org.glassfish.jersey.client.internal.HttpUrlConnector \ + --initialize-at-build-time=org.eclipse.yasson diff --git a/reactive/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver/native-image.properties b/reactive/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.reactive.webserver/helidon-reactive-webserver/native-image.properties similarity index 100% rename from reactive/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver/native-image.properties rename to reactive/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.reactive.webserver/helidon-reactive-webserver/native-image.properties diff --git a/reactive/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver/reflect-config.json b/reactive/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.reactive.webserver/helidon-reactive-webserver/reflect-config.json similarity index 100% rename from reactive/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver/reflect-config.json rename to reactive/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.reactive.webserver/helidon-reactive-webserver/reflect-config.json diff --git a/security/providers/oidc-common/src/main/resources/META-INF/native-image/native-image.properties b/security/providers/oidc-common/src/main/resources/META-INF/native-image/io.helidon.security.providers/helidon-security-providers-oidc-common/native-image.properties similarity index 87% rename from security/providers/oidc-common/src/main/resources/META-INF/native-image/native-image.properties rename to security/providers/oidc-common/src/main/resources/META-INF/native-image/io.helidon.security.providers/helidon-security-providers-oidc-common/native-image.properties index a840c5f2a37..14dc9dc2da9 100644 --- a/security/providers/oidc-common/src/main/resources/META-INF/native-image/native-image.properties +++ b/security/providers/oidc-common/src/main/resources/META-INF/native-image/io.helidon.security.providers/helidon-security-providers-oidc-common/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,5 +16,4 @@ Args=-H:EnableURLProtocols=http \ -H:EnableURLProtocols=https \ - --enable-all-security-services \ --initialize-at-build-time=io.helidon.security.providers.oidc.common diff --git a/security/security/src/main/resources/META-INF/native-image/io.helidon.security/helidon-security/native-image.properties b/security/security/src/main/resources/META-INF/native-image/io.helidon.security/helidon-security/native-image.properties index abc13ca74a8..9f1f44505e7 100644 --- a/security/security/src/main/resources/META-INF/native-image/io.helidon.security/helidon-security/native-image.properties +++ b/security/security/src/main/resources/META-INF/native-image/io.helidon.security/helidon-security/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,12 +14,5 @@ # limitations under the License. # -# -# Graal native image supports additional configuration from this property file. # Security Subject requires this to work -# The `all-security-services` is to support encryption algorithms, -# intermediate solution until we can figure out -# how to do a fine-grained algorithm support -# -Args=-H:IncludeResourceBundles=sun.security.util.Resources \ - --enable-all-security-services +Args=-H:IncludeResourceBundles=sun.security.util.Resources diff --git a/tests/integration/native-image/mp-1/README.md b/tests/integration/native-image/mp-1/README.md index 8dcf795171f..932a81d8b9e 100644 --- a/tests/integration/native-image/mp-1/README.md +++ b/tests/integration/native-image/mp-1/README.md @@ -35,7 +35,6 @@ ${GRAALVM_HOME}/bin/native-image -Dhelidon.native.reflection.trace-parsing=true -H:Name=helidon-tests-native-image-mp-1 \ "-H:IncludeResources=logging.properties|meta-config.yaml|web/resource.txt|web/welcome.txt|verify-jwk.json|META-INF/native-image/tests/mp-1/resource-config.json|META-INF/beans.xml|META-INF/microprofile-config.properties|sign-jwk.json" \ -H:+ReportExceptionStackTraces \ - --no-server \ -jar ./target/helidon-tests-native-image-mp-1.jar ``` diff --git a/tests/integration/native-image/mp-1/pom.xml b/tests/integration/native-image/mp-1/pom.xml index ff501d11e9a..95f1f512069 100644 --- a/tests/integration/native-image/mp-1/pom.xml +++ b/tests/integration/native-image/mp-1/pom.xml @@ -93,6 +93,13 @@ + + org.graalvm.buildtools + native-maven-plugin + + true + + diff --git a/tests/integration/native-image/mp-2/README.md b/tests/integration/native-image/mp-2/README.md index 75f0bdf7fc0..787287661e4 100644 --- a/tests/integration/native-image/mp-2/README.md +++ b/tests/integration/native-image/mp-2/README.md @@ -11,7 +11,7 @@ mvn clean package -Pnative-image ./target/helidon-tests-native-image-mp-2 ``` -Requires at least GraalVM 21.3.0 +Requires at least GraalVM 22.3.0 This test validates that JPA integration (using Hibernate) and JTA integration work in native image. diff --git a/tests/integration/native-image/mp-2/pom.xml b/tests/integration/native-image/mp-2/pom.xml index 4b8e371063c..4f16f368dc6 100644 --- a/tests/integration/native-image/mp-2/pom.xml +++ b/tests/integration/native-image/mp-2/pom.xml @@ -125,6 +125,13 @@ + + org.graalvm.buildtools + native-maven-plugin + + true + + org.jboss.jandex jandex-maven-plugin @@ -174,29 +181,4 @@ - - - native-image - - - - io.helidon.build-tools - helidon-maven-plugin - - ${mainClass} - main - - - - native-image - - native-image - - - - - - - - diff --git a/tests/integration/native-image/mp-2/src/main/resources/META-INF/native-image/tests/mp-2/native-image.properties b/tests/integration/native-image/mp-2/src/main/resources/META-INF/native-image/tests/mp-2/native-image.properties deleted file mode 100644 index 7abbaa30149..00000000000 --- a/tests/integration/native-image/mp-2/src/main/resources/META-INF/native-image/tests/mp-2/native-image.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2020, 2022 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Graal native image supports additional configuration from this property file. -# -Args=-H:+RemoveSaturatedTypeFlows diff --git a/tests/integration/native-image/mp-3/pom.xml b/tests/integration/native-image/mp-3/pom.xml index 8250dc1c191..ec2624107c7 100644 --- a/tests/integration/native-image/mp-3/pom.xml +++ b/tests/integration/native-image/mp-3/pom.xml @@ -53,6 +53,13 @@ + + org.graalvm.buildtools + native-maven-plugin + + true + + org.apache.maven.plugins maven-dependency-plugin diff --git a/tests/integration/native-image/mp-3/src/main/resources/META-INF/microprofile-config.properties b/tests/integration/native-image/mp-3/src/main/resources/META-INF/microprofile-config.properties index 1ef4e8f1dd7..2e4a439fa21 100644 --- a/tests/integration/native-image/mp-3/src/main/resources/META-INF/microprofile-config.properties +++ b/tests/integration/native-image/mp-3/src/main/resources/META-INF/microprofile-config.properties @@ -20,7 +20,6 @@ mp.config.profile=test app.greeting=Wrong Hello # Microprofile server properties -#server.port=7001 server.port=7001 server.host=0.0.0.0 %test.server.port=0 diff --git a/tests/integration/native-image/nima-1/src/main/java/io/helidon/tests/integration/nativeimage/nima1/WebClientService.java b/tests/integration/native-image/nima-1/src/main/java/io/helidon/tests/integration/nativeimage/nima1/WebClientService.java index 4b402ea6abc..b18a0a46e71 100644 --- a/tests/integration/native-image/nima-1/src/main/java/io/helidon/tests/integration/nativeimage/nima1/WebClientService.java +++ b/tests/integration/native-image/nima-1/src/main/java/io/helidon/tests/integration/nativeimage/nima1/WebClientService.java @@ -48,7 +48,7 @@ public WebClientService(Config config, MockZipkinService zipkinService) { client = WebClient.builder() .baseUri(context) // TODO: improvement - // .addHeader(Http.Header.ACCEPT, MediaTypes.APPLICATION_JSON.toString()) + // .addHeader(Http.Header.ACCEPT, MediaTypes.APPLICATION_JSON) // .config(config.get("client")) .build(); } diff --git a/tests/integration/native-image/se-1/pom.xml b/tests/integration/native-image/se-1/pom.xml index d027b072bc7..bb1615fbd40 100644 --- a/tests/integration/native-image/se-1/pom.xml +++ b/tests/integration/native-image/se-1/pom.xml @@ -127,6 +127,13 @@ + + org.graalvm.buildtools + native-maven-plugin + + true + + org.apache.maven.plugins maven-dependency-plugin diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/MockZipkinService.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/MockZipkinService.java index 23dfe3e90f5..8cb7853ab18 100644 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/MockZipkinService.java +++ b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/MockZipkinService.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.StringReader; import java.nio.ByteBuffer; +import java.util.List; import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; @@ -79,7 +80,7 @@ CompletionStage next() { } private void mockZipkin(final ServerRequest request, final ServerResponse response) { - request.queryParams().all("serviceName").forEach(s -> System.out.println(">>>" + s)); + request.queryParams().all("serviceName", List::of).forEach(s -> System.out.println(">>>" + s)); request.content() .registerReader(new MessageBodyStreamReader() { @Override diff --git a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebClientService.java b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebClientService.java index d10fb21439a..da9a64709fc 100644 --- a/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebClientService.java +++ b/tests/integration/native-image/se-1/src/main/java/io/helidon/tests/integration/nativeimage/se1/WebClientService.java @@ -54,7 +54,7 @@ public WebClientService(Config config, MockZipkinService zipkinService) { client = WebClient.builder() .baseUri(context) .addReader(JsonbSupport.reader()) - .addHeader(Http.Header.ACCEPT, MediaTypes.APPLICATION_JSON.toString()) + .addHeader(Http.HeaderValues.ACCEPT_JSON) .config(config.get("client")) .build(); } @@ -96,7 +96,7 @@ private void getTest(final ServerRequest request, final ServerResponse response) response.status(Http.Status.INTERNAL_SERVER_ERROR_500); StringWriter writer = new StringWriter(); t.printStackTrace(new PrintWriter(writer)); - response.send("Failed to process request: " + writer.toString()); + response.send("Failed to process request: " + writer); } }); } diff --git a/tracing/jaeger/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-jaeger/native-image.properties b/tracing/jaeger/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-jaeger/native-image.properties index 56fb195a344..b0bdcb8a31d 100644 --- a/tracing/jaeger/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-jaeger/native-image.properties +++ b/tracing/jaeger/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-jaeger/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,5 @@ Args=--initialize-at-build-time=org.slf4j,io.helidon.tracing.jaeger \ -H:+AddAllCharsets \ - --enable-all-security-services \ -H:EnableURLProtocols=http \ -H:EnableURLProtocols=https diff --git a/tracing/zipkin/src/main/resources/META-INF/native-image/native-image.properties b/tracing/zipkin/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-zipkin/native-image.properties similarity index 93% rename from tracing/zipkin/src/main/resources/META-INF/native-image/native-image.properties rename to tracing/zipkin/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-zipkin/native-image.properties index c29a62f531c..c32396f5f67 100644 --- a/tracing/zipkin/src/main/resources/META-INF/native-image/native-image.properties +++ b/tracing/zipkin/src/main/resources/META-INF/native-image/io.helidon.tracing/helidon-tracing-zipkin/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 Oracle and/or its affiliates. +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/reactive/webclient/jaxrs/src/main/resources/META-INF/native-image/native-image.properties b/webclient/jaxrs/src/main/resources/META-INF/native-image/io.helidon.webclient/helidon-webclient-jaxrs/native-image.properties similarity index 67% rename from reactive/webclient/jaxrs/src/main/resources/META-INF/native-image/native-image.properties rename to webclient/jaxrs/src/main/resources/META-INF/native-image/io.helidon.webclient/helidon-webclient-jaxrs/native-image.properties index 5dcfae920d5..f537a9f3502 100644 --- a/reactive/webclient/jaxrs/src/main/resources/META-INF/native-image/native-image.properties +++ b/webclient/jaxrs/src/main/resources/META-INF/native-image/io.helidon.webclient/helidon-webclient-jaxrs/native-image.properties @@ -14,6 +14,11 @@ # limitations under the License. # +<<<<<<<< HEAD:reactive/webclient/jaxrs/src/main/resources/META-INF/native-image/native-image.properties Args=-H:ReflectionConfigurationResources=${.}/helidon-reactive-webclient-jaxrs-reflection-config.json \ -H:EnableURLProtocols=http \ --initialize-at-build-time=io.helidon.reactive.webclient.jaxrs +======== +Args=-H:EnableURLProtocols=http \ + --initialize-at-build-time=io.helidon.webclient.jaxrs +>>>>>>>> 4a4e044e9 (Upgrade GraalVM native image to 22.3.0 (#5308)):webclient/jaxrs/src/main/resources/META-INF/native-image/io.helidon.webclient/helidon-webclient-jaxrs/native-image.properties diff --git a/reactive/webclient/jaxrs/src/main/resources/META-INF/native-image/helidon-webclient-jaxrs-reflection-config.json b/webclient/jaxrs/src/main/resources/META-INF/native-image/io.helidon.webclient/helidon-webclient-jaxrs/reflect-config.json similarity index 100% rename from reactive/webclient/jaxrs/src/main/resources/META-INF/native-image/helidon-webclient-jaxrs-reflection-config.json rename to webclient/jaxrs/src/main/resources/META-INF/native-image/io.helidon.webclient/helidon-webclient-jaxrs/reflect-config.json