Skip to content

Commit

Permalink
Merge branch 'main' into update-vertx-446
Browse files Browse the repository at this point in the history
  • Loading branch information
bartm-dvb authored Oct 16, 2023
2 parents 2e56114 + b29c4fd commit 81416ab
Show file tree
Hide file tree
Showing 36 changed files with 150 additions and 132 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -771,11 +771,11 @@ jobs:
path: .
- name: Extract .m2/repository/io/quarkus
run: tar -xzf m2-io-quarkus.tgz -C ~
- name: Set up JDK 20
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 20
java-version: 21
# We do this so we can get better analytics for the downloaded version of the build images
- name: Update Docker Client User Agent
run: |
Expand All @@ -785,7 +785,7 @@ jobs:
TEST_MODULES: ${{matrix.test-modules}}
CONTAINER_BUILD: ${{startsWith(matrix.os-name, 'windows') && 'false' || 'true'}}
run: |
export LANG=en_US && ./mvnw $COMMON_MAVEN_ARGS -f integration-tests/virtual-threads -pl "$TEST_MODULES" $NATIVE_TEST_MAVEN_ARGS -Dextra-args=--enable-preview -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-20
export LANG=en_US && ./mvnw $COMMON_MAVEN_ARGS -f integration-tests/virtual-threads -pl "$TEST_MODULES" $NATIVE_TEST_MAVEN_ARGS -Dextra-args=--enable-preview -Dquarkus.native.container-build=true
- name: Upload build reports (if build failed)
uses: actions/upload-artifact@v3
if: ${{ failure() || cancelled() }}
Expand Down
4 changes: 2 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<classmate.version>1.5.1</classmate.version>
<!-- When updating, align bytebuddy.version to Hibernate needs as well (just below),
as well as hibernate-orm.version-for-documentation in docs/pom.xml -->
<hibernate-orm.version>6.2.11.Final</hibernate-orm.version>
<hibernate-orm.version>6.2.13.Final</hibernate-orm.version>
<bytebuddy.version>1.14.7</bytebuddy.version> <!-- Version controlled by Hibernate ORM's needs -->
<hibernate-commons-annotations.version>6.0.6.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM -->
<hibernate-reactive.version>2.0.6.Final</hibernate-reactive.version>
Expand Down Expand Up @@ -132,7 +132,7 @@
<mysql-jdbc.version>8.0.30</mysql-jdbc.version>
<mssql-jdbc.version>12.4.0.jre11</mssql-jdbc.version>
<adal4j.version>1.6.7</adal4j.version>
<oracle-jdbc.version>23.2.0.0</oracle-jdbc.version>
<oracle-jdbc.version>23.3.0.23.09</oracle-jdbc.version>
<derby-jdbc.version>10.14.2.0</derby-jdbc.version>
<db2-jdbc.version>11.5.8.0</db2-jdbc.version>
<shrinkwrap.version>1.2.6</shrinkwrap.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
@ConfigMapping(prefix = "quarkus.native")
public interface NativeConfig {

String DEFAULT_GRAALVM_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-17";
String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-17";
String DEFAULT_GRAALVM_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21";
String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21";

/**
* Comma-separated, additional arguments to pass to the build process.
Expand Down Expand Up @@ -225,7 +225,7 @@ default boolean isExplicitContainerBuild() {
interface BuilderImageConfig {
/**
* The docker image to use to do the image build. It can be one of `graalvm`, `mandrel`, or the full image path, e.g.
* {@code quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-17}.
* {@code quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21}.
*/
@WithParentName
@WithDefault("${platform.quarkus.native.builder-image}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static final class Version implements Comparable<Version> {
public static final Version VERSION_23_1_0 = new Version("GraalVM 23.1.0", "23.1.0", Distribution.GRAALVM);

public static final Version MINIMUM = VERSION_22_2_0;
public static final Version CURRENT = VERSION_23_0_0;
public static final Version CURRENT = VERSION_23_1_0;
public static final int UNDEFINED = -1;

final String fullVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ class NativeConfigTest {
@Test
public void testBuilderImageProperlyDetected() {
assertThat(createConfig("graalvm").builderImage().getEffectiveImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("GraalVM").builderImage().getEffectiveImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("GraalVM").builderImage().getEffectiveImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("GRAALVM").builderImage().getEffectiveImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("jdk-17");
.contains("jdk-21");

assertThat(createConfig("mandrel").builderImage().getEffectiveImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("Mandrel").builderImage().getEffectiveImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("MANDREL").builderImage().getEffectiveImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("jdk-17");
.contains("jdk-21");

assertThat(createConfig("aRandomString").builderImage().getEffectiveImage()).isEqualTo("aRandomString");
}
Expand Down
8 changes: 4 additions & 4 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<properties>
<!-- The Graal version we suggest using in documentation - as that's
what we work with by self downloading it: -->
<graal-community.version-for-documentation>for JDK 17</graal-community.version-for-documentation>
<graal-community.tag-for-documentation>jdk17</graal-community.tag-for-documentation>
<graal-community.image-tag-for-documentation>jdk-17</graal-community.image-tag-for-documentation>
<mandrel.image-tag-for-documentation>jdk-17</mandrel.image-tag-for-documentation>
<graal-community.version-for-documentation>for JDK 21</graal-community.version-for-documentation>
<graal-community.tag-for-documentation>jdk21</graal-community.tag-for-documentation>
<graal-community.image-tag-for-documentation>jdk-21</graal-community.image-tag-for-documentation>
<mandrel.image-tag-for-documentation>jdk-21</mandrel.image-tag-for-documentation>

<assembly-maven-plugin.version>3.5.0</assembly-maven-plugin.version>
<asciidoctor-maven-plugin.version>2.0.0</asciidoctor-maven-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[source,bash,subs=attributes+, role="primary asciidoc-tabs-sync-cli"]
.CLI
----
quarkus extension add '{add-extension-extensions}'
quarkus extension add {add-extension-extensions}
----
ifndef::devtools-no-maven[]
ifdef::devtools-wrapped[+]
Expand Down
11 changes: 0 additions & 11 deletions docs/src/main/asciidoc/building-native-image.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,6 @@ In this case, use the parameter `-Dquarkus.native.remote-container-build=true` i
The reason for this is that the local build driver invoked through `-Dquarkus.native.container-build=true` uses volume mounts to make the JAR available in the build container, but volume mounts do not work with remote daemons. The remote container build driver copies the necessary files instead of mounting them. Note that even though the remote driver also works with local daemons, the local driver should be preferred in the local case because mounting is usually more performant than copying.
====

[TIP]
====
The builder image used by default supports Java 17 as it is the latest LTS version.
If your application uses Java 18 or later, you need to specify a builder image supporting Java 20:
:build-additional-parameters: -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-20
include::{includes}/devtools/build-native-container-parameters.adoc[]
:!build-additional-parameters:
====

[TIP]
====
Building with GraalVM instead of Mandrel requires a custom builder image parameter to be passed additionally:
Expand Down
16 changes: 0 additions & 16 deletions docs/src/main/asciidoc/datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -303,22 +303,6 @@ Quarkus offers several reactive clients for use with a reactive datasource.
+
The installed extension must be consistent with the `quarkus.datasource.db-kind` you define in your datasource configuration.

[WARNING]
====
The Reactive Oracle datasource depends on the https://docs.oracle.com/en/database/oracle/oracle-database/23/jjdbc/jdbc-reactive-extensions.html[Reactive Extensions] provided by Oracle in its JDBC driver.
There is a bug in versions 23.2 and 21.11 of the Oracle JDBC driver that prevents from getting any response if:
* Reactive Extensions are used to execute an update/insert query that ends with an error (e.g. constraint violation), and
* https://vertx.io/docs/vertx-oracle-client/java/#_retrieving_generated_key_values[generated keys retrieval] is enabled.
It is not known yet when the bug will be fixed.
In the meantime, you can either:
* change the version of the driver in your project to `com.oracle.database.jdbc:ojdbc11:21.10.0.0`, or
* avoid executing queries with generated keys retrieval (e.g. load sequence value before inserting)
====

. After adding the driver, configure the connection URL and define a proper size for your connection pool.
+
[source,properties]
Expand Down
13 changes: 13 additions & 0 deletions docs/src/main/asciidoc/native-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,19 @@ For example, when registering types and methods for reflection access,
the analysis can’t easily see what’s behind those types or methods,
so it has to do more work to complete the analysis step.

[[native-faq-experimental-options]]
=== I get a warning about using experimental options, what can I do?

Starting with Mandrel 23.1 and GraalVM for JDK 21, the native executable generation process will warn about the use of experimental options with a message like this:

[source,bash]
----
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.micrometer/micrometer-core/reflect-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
----

If the mentioned option is added by a third party library like in the example above, you should consider opening an issue in the library's repository to ask for the option to be removed.
If the option is added by your application, you should consider either removing it (if it's not necessary) or wrapping it between `-H:+UnlockExperimentalVMOptions` and `-H:-UnlockExperimentalVMOptions`.

=== I get a `AnalysisError\$ParsingError` when building a native executable due to an `UnresolvedElementException`, what can I do?

When building a native executable Quarkus requires all classes being referenced by the code, no matter if they are build-time or run-time initialized, to be present in the classpath.
Expand Down
9 changes: 2 additions & 7 deletions docs/src/main/asciidoc/virtual-threads.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,10 @@ Then, add to your `application.properties` file:

[source, properties]
----
quarkus.native.additional-build-args=--enable-preview <1>
# In-container build to get a linux 64 executable
quarkus.native.container-build=true <2>
quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-20 <3>
quarkus.native.container-build=true <1>
----
<1> The `enable-preview` flag in only necessary until Java 21.
<2> Enables the in-container build
<3> The builder container to use. Make sure it supports virtual threads
<1> Enables the in-container build

[IMPORTANT]
.From ARM/64 to AMD/64
Expand Down
60 changes: 52 additions & 8 deletions docs/src/main/asciidoc/writing-native-applications-tips.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ So this directory is not a shortcut for "let's automatically include these resou
Other resources should be declared explicitly.
====

==== Using the `quarkus.native.resources.includes` configuration property

To include more resources in the native executable, the easiest way is to use the `quarkus.native.resources.includes` configuration property,
and its counterpart to exclude resources `quarkus.native.resources.excludes`.

Expand All @@ -55,8 +57,19 @@ will include:
* all files in the `foo/` directory and its subdirectories except for files in `foo/private/` and its subdirectories,
* all text files in the `bar/` directory and its subdirectories.

==== Using a configuration file

If globs are not sufficiently precise for your use case and you need to rely on regular expressions, or if you prefer relying on the GraalVM infrastructure,
you can also create a `resources-config.json` (the most common location is within `src/main/resources`) JSON file defining which resources should be included:
you can also create a `resources-config.json` (the most common location is within `src/main/resources`) JSON file defining which resources should be included.

[WARNING]
====
Relying on the GraalVM infrastructure means that you are responsible for keeping the configuration file up to date as new Mandrel and GraalVM versions are released.
Please also note that the `resources-config.json` file will be overwritten by Quarkus if placed directly under `src/main/resources/META-INF/native-image/` as Quarkus generates its own configuration file in this directory.
====

An example of such a file is the following:

[source,json]
----
Expand Down Expand Up @@ -84,9 +97,18 @@ The final order of business is to make the configuration file known to the `nati

[source,properties]
----
quarkus.native.additional-build-args =-H:ResourceConfigurationFiles=resources-config.json
quarkus.native.additional-build-args =\
-H:+UnlockExperimentalVMOptions,\
-H:ResourceConfigurationFiles=resources-config.json,\
-H:-UnlockExperimentalVMOptions
----

[NOTE]
====
Starting with Mandrel 23.1 and GraalVM for JDK 21, `-H:ResourceConfigurationFiles=resources-config.json` results in a warning being shown unless wrapped in `-H:+UnlockExperimentalVMOptions` and `-H:-UnlockExperimentalVMOptions`.
The absence of these options will result in build failures in the future.
====

In the previous snippet we were able to simply use `resources-config.json` instead of specifying the entire path of the file simply because it was added to `src/main/resources`.
If the file had been added to another directory, the proper file path would have had to be specified manually.

Expand All @@ -97,8 +119,10 @@ Multiple options may be separated by a comma. For example, one could use:
[source,properties]
----
quarkus.native.additional-build-args =\
-H:+UnlockExperimentalVMOptions,\
-H:ResourceConfigurationFiles=resources-config.json,\
-H:ReflectionConfigurationFiles=reflection-config.json
-H:ReflectionConfigurationFiles=reflection-config.json,\
-H:-UnlockExperimentalVMOptions
----
in order to ensure that various resources are included and additional reflection is registered.
Expand All @@ -115,7 +139,9 @@ When using Maven, we could use the following configuration:
<id>native</id>
<properties>
<quarkus.package.type>native</quarkus.package.type>
<quarkus.native.additional-build-args>-H:ResourceConfigurationFiles=resources-config.json</quarkus.native.additional-build-args>
<quarkus.native.additional-build-args>
-H:+UnlockExperimentalVMOptions,-H:ResourceConfigurationFiles=resources-config.json,-H:-UnlockExperimentalVMOptions
</quarkus.native.additional-build-args>
</properties>
</profile>
</profiles>
Expand Down Expand Up @@ -225,7 +251,12 @@ public class MyReflectionConfiguration {

==== Using a configuration file

You can use a configuration file to register classes for reflection.
You can also use a configuration file to register classes for reflection, if you prefer relying on the GraalVM infrastructure.

[WARNING]
====
Relying on the GraalVM infrastructure means that you are responsible for keeping the configuration file up to date as new Mandrel and GraalVM versions are released.
====

As an example, in order to register all methods of class `com.acme.MyClass` for reflection, we create `reflection-config.json` (the most common location is within `src/main/resources`)

Expand Down Expand Up @@ -253,9 +284,18 @@ The final order of business is to make the configuration file known to the `nati

[source,properties]
----
quarkus.native.additional-build-args =-H:ReflectionConfigurationFiles=reflection-config.json
quarkus.native.additional-build-args =\
-H:+UnlockExperimentalVMOptions,\
-H:ReflectionConfigurationFiles=reflection-config.json,\
-H:-UnlockExperimentalVMOptions
----

[NOTE]
====
Starting with Mandrel 23.1 and GraalVM for JDK 21, `-H:ResourceConfigurationFiles=resources-config.json` results in a warning being shown unless wrapped in `-H:+UnlockExperimentalVMOptions` and `-H:-UnlockExperimentalVMOptions`.
The absence of these options will result in build failures in the future.
====

In the previous snippet we were able to simply use `reflection-config.json` instead of specifying the entire path of the file simply because it was added to `src/main/resources`.
If the file had been added to another directory, the proper file path would have had to be specified manually.

Expand All @@ -266,8 +306,10 @@ Multiple options may be separated by a comma. For example, one could use:
[source,properties]
----
quarkus.native.additional-build-args =\
-H:+UnlockExperimentalVMOptions,\
-H:ResourceConfigurationFiles=resources-config.json,\
-H:ReflectionConfigurationFiles=reflection-config.json
-H:ReflectionConfigurationFiles=reflection-config.json,\
-H:-UnlockExperimentalVMOptions
----
in order to ensure that various resources are included and additional reflection is registered.
Expand All @@ -284,7 +326,9 @@ When using Maven, we could use the following configuration:
<id>native</id>
<properties>
<quarkus.package.type>native</quarkus.package.type>
<quarkus.native.additional-build-args>-H:ReflectionConfigurationFiles=reflection-config.json</quarkus.native.additional-build-args>
<quarkus.native.additional-build-args>
-H:+UnlockExperimentalVMOptions,-H:ReflectionConfigurationFiles=reflection-config.json,-H:-UnlockExperimentalVMOptions
</quarkus.native.additional-build-args>
</properties>
</profile>
</profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.hamcrest.Matchers.equalTo;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

Expand All @@ -11,6 +12,7 @@
import io.restassured.RestAssured;

@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class)
@Disabled
public class GraphQLClientUsingOidcClientTest {

private static final Class<?>[] testClasses = {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.quarkus.opentelemetry.deployment.exporter.otlp;

import io.quarkus.builder.item.MultiBuildItem;

/**
* Build item to be used by Quarkiverse exporters to register themselves as an external exporter.
*/
final public class ExternalOtelExporterBuildItem extends MultiBuildItem {
final private String exporterName;

public ExternalOtelExporterBuildItem(String exporterName) {
this.exporterName = exporterName;
}

public String getExporterName() {
return exporterName;
}
}
Loading

0 comments on commit 81416ab

Please sign in to comment.