From ab55048e62f26d74b68e51d9140624f40a1e4eac Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Sat, 9 Dec 2023 01:34:04 +0200 Subject: [PATCH 01/12] Netty requires more classes to be runtime initialized In https://github.com/quarkusio/quarkus/pull/37347 we moved `PlatformDependent` and `PlatformDependent0` classes to run-time-initialization as they are platform-dependent and thus need to be initialized on the target platform. It looks like there are more classes like these that need to be runtime initialized as they transitively rely on platform dependent values. Closes https://github.com/Karm/mandrel-integration-tests/issues/236 Supersedes https://github.com/quarkusio/quarkus/pull/37628 (cherry picked from commit 72d7b79a7a67344145df94b98a271c7393777f90) --- .../netty/deployment/NettyProcessor.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java index 5de637d124c8c..8d0f294af25fe 100644 --- a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java +++ b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java @@ -162,8 +162,28 @@ NativeImageConfigBuildItem build( log.debug("Not registering Netty native kqueue classes as they were not found"); } - builder.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent"); - builder.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent0"); + builder.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent") + .addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent0") + .addRuntimeReinitializedClass("io.netty.buffer.PooledByteBufAllocator"); + + if (QuarkusClassLoader.isClassPresentAtRuntime("io.netty.buffer.UnpooledByteBufAllocator")) { + builder.addRuntimeReinitializedClass("io.netty.buffer.UnpooledByteBufAllocator") + .addRuntimeReinitializedClass("io.netty.buffer.Unpooled") + .addRuntimeReinitializedClass("io.vertx.core.http.impl.Http1xServerResponse") + .addRuntimeReinitializedClass("io.netty.handler.codec.http.HttpObjectAggregator") + .addRuntimeReinitializedClass("io.netty.handler.codec.ReplayingDecoderByteBuf") + .addRuntimeReinitializedClass("io.vertx.core.parsetools.impl.RecordParserImpl"); + + if (QuarkusClassLoader.isClassPresentAtRuntime("io.vertx.ext.web.client.impl.MultipartFormUpload")) { + builder.addRuntimeReinitializedClass("io.vertx.ext.web.client.impl.MultipartFormUpload"); + } + + if (QuarkusClassLoader + .isClassPresentAtRuntime("org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartFormUpload")) { + builder.addRuntimeReinitializedClass( + "org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartFormUpload"); + } + } return builder //TODO: make configurable .build(); From 602b2dd42e4621f51f7deba6d37242f5c372acaf Mon Sep 17 00:00:00 2001 From: Max Rydahl Andersen Date: Mon, 8 Jan 2024 22:21:28 +0100 Subject: [PATCH 02/12] doc: mention registration is per extension not per repo (cherry picked from commit e7cdc2f50d3cb2545e2b713afa1d97182ded20a4) --- docs/src/main/asciidoc/writing-extensions.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/main/asciidoc/writing-extensions.adoc b/docs/src/main/asciidoc/writing-extensions.adoc index 861bfa9fb9578..61b7dee65d648 100644 --- a/docs/src/main/asciidoc/writing-extensions.adoc +++ b/docs/src/main/asciidoc/writing-extensions.adoc @@ -3051,5 +3051,7 @@ group-id: artifact-id: ---- +NOTE: When your repository contains multiple extensions, you need to create a separate file for each individual extension, not just one file for the entire repository. + That's all. Once the pull request is merged, a scheduled job will check Maven Central for new versions and update the xref:extension-registry-user.adoc[Quarkus Extension Registry]. From 613d9e36139b227e2cc1a20611488e1dfe4db285 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 22:49:42 +0000 Subject: [PATCH 03/12] Bump io.quarkus.bot:build-reporter-maven-extension from 3.2.2 to 3.3.3 Bumps [io.quarkus.bot:build-reporter-maven-extension](https://github.com/quarkusio/build-reporter) from 3.2.2 to 3.3.3. - [Commits](https://github.com/quarkusio/build-reporter/compare/3.2.2...3.3.3) --- updated-dependencies: - dependency-name: io.quarkus.bot:build-reporter-maven-extension dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (cherry picked from commit 775ae550d6e4f717bf2bed0e0337a15430463d1f) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e041b8d91bff9..d60d6c8db4be1 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,7 @@ io.quarkus.bot build-reporter-maven-extension - 3.2.2 + 3.3.3 From f6082fbb536997faa3ca76e5cf086ff2fec971ab Mon Sep 17 00:00:00 2001 From: Jerome Prinet Date: Tue, 9 Jan 2024 14:48:47 +0100 Subject: [PATCH 04/12] Change storage location on CI to avoid Develocity scan dumps with disabled publication to be captured for republication (cherry picked from commit 5d61c691acce60e600fffa79a6f5dae7b1ad2535) --- .mvn/gradle-enterprise-custom-user-data.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.mvn/gradle-enterprise-custom-user-data.groovy b/.mvn/gradle-enterprise-custom-user-data.groovy index a076e48718294..cec7b24758994 100644 --- a/.mvn/gradle-enterprise-custom-user-data.groovy +++ b/.mvn/gradle-enterprise-custom-user-data.groovy @@ -12,6 +12,17 @@ if(session?.getRequest()?.getBaseDirectory() != null) { if(!publish) { // do not publish a build scan for test builds log.debug("Disabling build scan publication for " + session.getRequest().getBaseDirectory()) + + // change storage location on CI to avoid Develocity scan dumps with disabled publication to be captured for republication + if (System.env.GITHUB_ACTIONS) { + try { + def storageLocationTmpDir = java.nio.file.Files.createTempDirectory(java.nio.file.Paths.get(System.env.RUNNER_TEMP), "buildScanTmp").toAbsolutePath() + log.debug('Update storage location to ' + storageLocationTmpDir) + gradleEnterprise.setStorageDirectory(storageLocationTmpDir) + } catch (IOException e) { + log.error('Temporary storage location directory cannot be created, the Build Scan will be published', e) + } + } } } buildScan.publishAlwaysIf(publish) From 98ae832c7fa49e6b9ac53246997d8a6e2d8641a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Wed, 10 Jan 2024 12:58:06 +0100 Subject: [PATCH 05/12] Add missing methods to ReactiveMongoCollection Fixes #38114 (cherry picked from commit 8debb80c7e024deeb65c12a7a7fe25cf7c227265) --- .../impl/ReactiveMongoCollectionImpl.java | 63 +++++++ .../reactive/ReactiveMongoCollection.java | 169 ++++++++++++++++++ 2 files changed, 232 insertions(+) diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java index acac2af661e43..a122df0796b70 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/impl/ReactiveMongoCollectionImpl.java @@ -584,6 +584,27 @@ public Uni updateOne(ClientSession clientSession, Bson filter, Bso return Wrappers.toUni(collection.updateOne(clientSession, filter, update, options)); } + @Override + public Uni updateOne(Bson filter, List update) { + return Wrappers.toUni(collection.updateOne(filter, update)); + } + + @Override + public Uni updateOne(Bson filter, List update, UpdateOptions options) { + return Wrappers.toUni(collection.updateOne(filter, update, options)); + } + + @Override + public Uni updateOne(ClientSession clientSession, Bson filter, List update) { + return Wrappers.toUni(collection.updateOne(clientSession, filter, update)); + } + + @Override + public Uni updateOne(ClientSession clientSession, Bson filter, List update, + UpdateOptions options) { + return Wrappers.toUni(collection.updateOne(clientSession, filter, update, options)); + } + @Override public Uni updateMany(Bson filter, Bson update) { return Wrappers.toUni(collection.updateMany(filter, update)); @@ -605,6 +626,27 @@ public Uni updateMany(ClientSession clientSession, Bson filter, Bs return Wrappers.toUni(collection.updateMany(clientSession, filter, update, options)); } + @Override + public Uni updateMany(Bson filter, List update) { + return Wrappers.toUni(collection.updateMany(filter, update)); + } + + @Override + public Uni updateMany(Bson filter, List update, UpdateOptions options) { + return Wrappers.toUni(collection.updateMany(filter, update, options)); + } + + @Override + public Uni updateMany(ClientSession clientSession, Bson filter, List update) { + return Wrappers.toUni(collection.updateMany(clientSession, filter, update)); + } + + @Override + public Uni updateMany(ClientSession clientSession, Bson filter, List update, + UpdateOptions options) { + return Wrappers.toUni(collection.updateMany(clientSession, filter, update, options)); + } + @Override public Uni findOneAndDelete(Bson filter) { return Wrappers.toUni(collection.findOneAndDelete(filter)); @@ -667,6 +709,27 @@ public Uni findOneAndUpdate(ClientSession clientSession, Bson filter, Bson up return Wrappers.toUni(collection.findOneAndUpdate(clientSession, filter, update, options)); } + @Override + public Uni findOneAndUpdate(Bson filter, List update) { + return Wrappers.toUni(collection.findOneAndUpdate(filter, update)); + } + + @Override + public Uni findOneAndUpdate(Bson filter, List update, FindOneAndUpdateOptions options) { + return Wrappers.toUni(collection.findOneAndUpdate(filter, update, options)); + } + + @Override + public Uni findOneAndUpdate(ClientSession clientSession, Bson filter, List update) { + return Wrappers.toUni(collection.findOneAndUpdate(clientSession, filter, update)); + } + + @Override + public Uni findOneAndUpdate(ClientSession clientSession, Bson filter, List update, + FindOneAndUpdateOptions options) { + return Wrappers.toUni(collection.findOneAndUpdate(clientSession, filter, update, options)); + } + @Override public Uni drop() { return Wrappers.toUni(collection.drop()); diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/reactive/ReactiveMongoCollection.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/reactive/ReactiveMongoCollection.java index 65ecdb58f72a4..34c7532d1a7c8 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/reactive/ReactiveMongoCollection.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/reactive/ReactiveMongoCollection.java @@ -1014,6 +1014,62 @@ Uni replaceOne(ClientSession clientSession, Bson filter, T replace Uni updateOne(ClientSession clientSession, Bson filter, Bson update, UpdateOptions options); + /** + * Update a single document in the collection according to the specified arguments. + * + *

+ * Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. + *

+ * + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @return a publisher with a single element the UpdateResult + */ + Uni updateOne(Bson filter, List update); + + /** + * Update a single document in the collection according to the specified arguments. + * + *

+ * Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. + *

+ * + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @param options the options to apply to the update operation + * @return a publisher with a single element the UpdateResult + */ + Uni updateOne(Bson filter, List update, UpdateOptions options); + + /** + * Update a single document in the collection according to the specified arguments. + * + *

+ * Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. + *

+ * + * @param clientSession the client session with which to associate this operation + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @return a publisher with a single element the UpdateResult + */ + Uni updateOne(ClientSession clientSession, Bson filter, List update); + + /** + * Update a single document in the collection according to the specified arguments. + * + *

+ * Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. + *

+ * + * @param clientSession the client session with which to associate this operation + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @param options the options to apply to the update operation + * @return a publisher with a single element the UpdateResult + */ + Uni updateOne(ClientSession clientSession, Bson filter, List update, UpdateOptions options); + /** * Update all documents in the collection according to the specified arguments. * @@ -1059,6 +1115,46 @@ Uni updateOne(ClientSession clientSession, Bson filter, Bson updat Uni updateMany(ClientSession clientSession, Bson filter, Bson update, UpdateOptions options); + /** + * Update all documents in the collection according to the specified arguments. + * + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @return a publisher with a single element the UpdateResult + */ + Uni updateMany(Bson filter, List update); + + /** + * Update all documents in the collection according to the specified arguments. + * + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @param options the options to apply to the update operation + * @return a publisher with a single element the UpdateResult + */ + Uni updateMany(Bson filter, List update, UpdateOptions options); + + /** + * Update all documents in the collection according to the specified arguments. + * + * @param clientSession the client session with which to associate this operation + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @return a publisher with a single element the UpdateResult + */ + Uni updateMany(ClientSession clientSession, Bson filter, List update); + + /** + * Update all documents in the collection according to the specified arguments. + * + * @param clientSession the client session with which to associate this operation + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @param options the options to apply to the update operation + * @return a publisher with a single element the UpdateResult + */ + Uni updateMany(ClientSession clientSession, Bson filter, List update, UpdateOptions options); + /** * Atomically find a document and remove it. * @@ -1217,6 +1313,79 @@ Uni findOneAndReplace(ClientSession clientSession, Bson filter, T replacement Uni findOneAndUpdate(ClientSession clientSession, Bson filter, Bson update, FindOneAndUpdateOptions options); + /** + * Atomically find a document and update it. + * + *

+ * Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. + *

+ * + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @return a publisher with a single element the document that was updated. Depending on the value of the + * {@code returnOriginal} + * property, this will either be the document as it was before the update or as it is after the update. If no + * documents matched the + * query filter, then null will be returned + */ + Uni findOneAndUpdate(Bson filter, List update); + + /** + * Atomically find a document and update it. + * + *

+ * Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. + *

+ * + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @param options the options to apply to the operation + * @return a publisher with a single element the document that was updated. Depending on the value of the + * {@code returnOriginal} + * property, this will either be the document as it was before the update or as it is after the update. If no + * documents matched the + * query filter, then null will be returned + */ + Uni findOneAndUpdate(Bson filter, List update, FindOneAndUpdateOptions options); + + /** + * Atomically find a document and update it. + * + *

+ * Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. + *

+ * + * @param clientSession the client session with which to associate this operation + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @return a publisher with a single element the document that was updated. Depending on the value of the + * {@code returnOriginal} + * property, this will either be the document as it was before the update or as it is after the update. If no + * documents matched the + * query filter, then null will be returned + */ + Uni findOneAndUpdate(ClientSession clientSession, Bson filter, List update); + + /** + * Atomically find a document and update it. + * + *

+ * Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. + *

+ * + * @param clientSession the client session with which to associate this operation + * @param filter a document describing the query filter, which may not be null. + * @param update a pipeline describing the update, which may not be null. + * @param options the options to apply to the operation + * @return a publisher with a single element the document that was updated. Depending on the value of the + * {@code returnOriginal} + * property, this will either be the document as it was before the update or as it is after the update. If no + * documents matched the + * query filter, then null will be returned + */ + Uni findOneAndUpdate(ClientSession clientSession, Bson filter, List update, + FindOneAndUpdateOptions options); + /** * Drops this collection from the database. * From df32d25724216c96ab6f460e19d21ec6c355ca5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:35:14 +0000 Subject: [PATCH 06/12] Bump io.quarkus:quarkus-platform-bom-maven-plugin Bumps [io.quarkus:quarkus-platform-bom-maven-plugin](https://github.com/quarkusio/quarkus-platform-bom-generator) from 0.0.101 to 0.0.102. - [Release notes](https://github.com/quarkusio/quarkus-platform-bom-generator/releases) - [Commits](https://github.com/quarkusio/quarkus-platform-bom-generator/compare/0.0.101...0.0.102) --- updated-dependencies: - dependency-name: io.quarkus:quarkus-platform-bom-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (cherry picked from commit dfb3c93a5ef25b8aa3d4dd186fd768a8d6b1dbf8) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d60d6c8db4be1..8faf852836586 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ jdbc:postgresql:hibernate_orm_test 4.5.1 - 0.0.101 + 0.0.102 false false From 3c52567100eb982ed0a304db7b814a776a5524a8 Mon Sep 17 00:00:00 2001 From: Idryss Bourdier Date: Mon, 18 Dec 2023 16:06:57 +0100 Subject: [PATCH 07/12] Fixing Jaxb unmarshalling error with native compilation (cherry picked from commit 24b321e29b9b96f4731ec8bddc76a876c57c8dac) --- .../jaxb/deployment/JaxbProcessor.java | 22 ++++++++++++--- .../io/quarkus/it/jaxb/BookIBANField.java | 24 +++++++++++++++++ .../io/quarkus/it/jaxb/BookWithParent.java | 27 +++++++++++++++++++ .../java/io/quarkus/it/jaxb/JaxbResource.java | 15 +++++++++++ .../test/java/io/quarkus/it/jaxb/JaxbIT.java | 18 ++++++++++++- 5 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookIBANField.java create mode 100644 integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookWithParent.java diff --git a/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java b/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java index 17768f6d8e62b..3d488e9d012d9 100644 --- a/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java +++ b/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java @@ -70,6 +70,7 @@ import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageSystemPropertyBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem; import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; @@ -186,6 +187,7 @@ void processAnnotationsAndIndexFiles( BuildProducer proxyDefinitions, CombinedIndexBuildItem combinedIndexBuildItem, List fileRoots, + BuildProducer reflectiveHierarchies, BuildProducer reflectiveClass, BuildProducer resource, BuildProducer resourceBundle, @@ -202,10 +204,11 @@ void processAnnotationsAndIndexFiles( for (DotName jaxbRootAnnotation : JAXB_ROOT_ANNOTATIONS) { for (AnnotationInstance jaxbRootAnnotationInstance : index .getAnnotations(jaxbRootAnnotation)) { - if (jaxbRootAnnotationInstance.target().kind() == Kind.CLASS) { - String className = jaxbRootAnnotationInstance.target().asClass().name().toString(); - reflectiveClass.produce(ReflectiveClassBuildItem.builder(className).methods().fields().build()); - classesToBeBound.add(className); + if (jaxbRootAnnotationInstance.target().kind() == Kind.CLASS + && !JAXB_ANNOTATIONS.contains(jaxbRootAnnotationInstance.target().asClass().getClass())) { + DotName targetClass = jaxbRootAnnotationInstance.target().asClass().name(); + addReflectiveHierarchyClass(targetClass, reflectiveHierarchies, index); + classesToBeBound.add(targetClass.toString()); jaxbRootAnnotationsDetected = true; } } @@ -412,6 +415,17 @@ public static Stream safeWalk(Path p) { } } + private void addReflectiveHierarchyClass(DotName className, + BuildProducer reflectiveHierarchy, + IndexView index) { + Type jandexType = Type.create(className, Type.Kind.CLASS); + reflectiveHierarchy.produce(new ReflectiveHierarchyBuildItem.Builder() + .type(jandexType) + .index(index) + .source(getClass().getSimpleName() + " > " + jandexType.name().toString()) + .build()); + } + private void addReflectiveClass(BuildProducer reflectiveClass, boolean methods, boolean fields, String... className) { reflectiveClass.produce(new ReflectiveClassBuildItem(methods, fields, className)); diff --git a/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookIBANField.java b/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookIBANField.java new file mode 100644 index 0000000000000..5fc7a28bdcfa9 --- /dev/null +++ b/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookIBANField.java @@ -0,0 +1,24 @@ +package io.quarkus.it.jaxb; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlTransient; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlTransient +public abstract class BookIBANField { + @XmlElement + private String IBAN; + + public BookIBANField() { + } + + public void setIBAN(String IBAN) { + this.IBAN = IBAN; + } + + public String getIBAN() { + return IBAN; + } +} diff --git a/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookWithParent.java b/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookWithParent.java new file mode 100644 index 0000000000000..d4d81b481e267 --- /dev/null +++ b/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookWithParent.java @@ -0,0 +1,27 @@ +package io.quarkus.it.jaxb; + +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +@XmlRootElement +@XmlType(propOrder = { "IBAN", "title" }) +public class BookWithParent extends BookIBANField { + @XmlElement + private String title; + + public BookWithParent() { + } + + public BookWithParent(String title) { + this.title = title; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/JaxbResource.java b/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/JaxbResource.java index b03507a82089e..d6a9b8e386574 100644 --- a/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/JaxbResource.java +++ b/integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/JaxbResource.java @@ -65,4 +65,19 @@ public io.quarkus.it.jaxb.Response seeAlso() { return response; } + //Test for Jaxb with parent class field + @Path("/bookwithparent") + @GET + @Produces(MediaType.TEXT_PLAIN) + public String getBookWithParent(@QueryParam("name") String name, @QueryParam("iban") String iban) throws JAXBException { + BookWithParent bookWithParent = new BookWithParent(); + bookWithParent.setTitle(name); + bookWithParent.setIBAN(iban); + JAXBContext context = JAXBContext.newInstance(bookWithParent.getClass()); + Marshaller marshaller = context.createMarshaller(); + StringWriter sw = new StringWriter(); + marshaller.marshal(bookWithParent, sw); + return sw.toString(); + } + } diff --git a/integration-tests/jaxb/src/test/java/io/quarkus/it/jaxb/JaxbIT.java b/integration-tests/jaxb/src/test/java/io/quarkus/it/jaxb/JaxbIT.java index ae862b4a11e41..06611d4a0c081 100644 --- a/integration-tests/jaxb/src/test/java/io/quarkus/it/jaxb/JaxbIT.java +++ b/integration-tests/jaxb/src/test/java/io/quarkus/it/jaxb/JaxbIT.java @@ -1,8 +1,24 @@ package io.quarkus.it.jaxb; +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.is; + +import org.junit.jupiter.api.Test; + import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest public class JaxbIT extends JaxbTest { - + //We have to test native executable of Jaxb + @Test + public void bookWithParent() { + given().when() + .param("name", "Foundation") + .param("iban", "4242") + .get("/jaxb/bookwithparent") + .then() + .statusCode(200) + .body(is( + "4242Foundation")); + } } From 65cac1bf3f58dc0062a977f381d7eead5170ec7e Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 15 Jan 2024 08:56:50 +0200 Subject: [PATCH 08/12] Add necessary Vertx dependency to quarkus-cache Fixes: #38157 (cherry picked from commit dfb681e24f005aebadd1624f70d9d84b34769597) --- extensions/cache/deployment/pom.xml | 4 ++++ extensions/cache/runtime/pom.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/extensions/cache/deployment/pom.xml b/extensions/cache/deployment/pom.xml index 055055a4c594c..7d8309729061c 100644 --- a/extensions/cache/deployment/pom.xml +++ b/extensions/cache/deployment/pom.xml @@ -38,6 +38,10 @@ io.quarkus quarkus-mutiny-deployment + + io.quarkus + quarkus-vertx-deployment + io.quarkus quarkus-vertx-http-dev-ui-spi diff --git a/extensions/cache/runtime/pom.xml b/extensions/cache/runtime/pom.xml index 70993637b709a..e849a5b223d04 100644 --- a/extensions/cache/runtime/pom.xml +++ b/extensions/cache/runtime/pom.xml @@ -27,6 +27,10 @@ io.quarkus quarkus-mutiny + + io.quarkus + quarkus-vertx + io.quarkus quarkus-cache-runtime-spi From 91f31116f1000f7764a9a06769aff24f6e5dad0e Mon Sep 17 00:00:00 2001 From: Max Rydahl Andersen Date: Mon, 8 Jan 2024 09:53:00 +0100 Subject: [PATCH 09/12] Add exclude + additionals option to AssembleDownstreamDocumentation Why: * downstreamdoc.yaml is used to generate the list of docs used by downstream doc builds and today its hardcoded thus very limited for downstream docs ability to adjust without changing the quarkus repo. This change addreses the need by: * adding a DOWNSTREAM_CONFIG_FILE to *optionally* override the hardcoded downstreamdoc.yaml * adding a DOWNSTREAM_ADDITONALS env var to the downstream doc build that can be used to add docs to the list of docs used by downstream doc builds * adding a DOWNSTREAM_EXCLUDES env var to the downstream doc build that can be used to exclude docs from the list of docs used by downstream doc builds + additionals (cherry picked from commit 865a88214a5aae7148c2cf63b5e78b637babda82) --- .../AssembleDownstreamDocumentation.java | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java b/docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java index dbb4c74cd9b5c..0acc2d32ddf43 100755 --- a/docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java +++ b/docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java @@ -1,11 +1,17 @@ package io.quarkus.docs.generation; +//These are here to allow running the script directly from command line/IDE +//The real deps and call are in the pom.xml +//DEPS org.jboss.logging:jboss-logging:3.4.1.Final +//DEPS com.fasterxml.jackson.core:jackson-databind:2.12.3 +//DEPS com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.0.rc1 import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Map; @@ -88,7 +94,30 @@ public static void main(String[] args) throws Exception { ObjectMapper yamlObjectMapper = new ObjectMapper(new YAMLFactory()); yamlObjectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - ConfigFile configFile = yamlObjectMapper.readValue(new File("downstreamdoc.yaml"), ConfigFile.class); + String configFilePath = System.getenv("DOWNSTREAM_CONFIG_FILE"); + if (configFilePath == null) { + configFilePath = "downstreamdoc.yaml"; + } + ConfigFile configFile = yamlObjectMapper.readValue(new File(configFilePath), ConfigFile.class); + + String additionals = System.getenv("DOWNSTREAM_ADDITIONALS"); + if (additionals != null) { + String[] additional_files = additionals.split(","); + LOG.info("Additional files: " + Arrays.toString(additional_files)); + for (String file : additional_files) { + configFile.guides.add(file); + } + } + + String excludes = System.getenv("DOWNSTREAM_EXCLUDES"); + if (excludes != null) { + String[] excludePatterns = excludes.split(","); + LOG.info("Excluding patterns: " + Arrays.toString(excludePatterns)); + for (String pattern : excludePatterns) { + Pattern regexPattern = Pattern.compile(pattern); + configFile.guides.removeIf(guide -> regexPattern.matcher(guide).find()); + } + } Set guides = new TreeSet<>(); Set simpleIncludes = new TreeSet<>(); From 20d566cb2ceb329bafdc5c2804ecc785603c85b8 Mon Sep 17 00:00:00 2001 From: SIMULATAN Date: Wed, 10 Jan 2024 13:30:06 +0100 Subject: [PATCH 10/12] ConfigRecorder: fix value changed check with null build-time values (cherry picked from commit 0ebd47b80291da39602dd6f189ad2eba60f16b3a) --- .../java/io/quarkus/runtime/configuration/ConfigRecorder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigRecorder.java b/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigRecorder.java index ff18b51bb6562..ebf0ed694bbdf 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigRecorder.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigRecorder.java @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; import org.eclipse.microprofile.config.ConfigProvider; @@ -42,7 +43,8 @@ public void handleConfigChange(Map buildTimeRuntimeValues) for (Map.Entry entry : buildTimeRuntimeValues.entrySet()) { ConfigValue currentValue = config.getConfigValue(entry.getKey()); // Check for changes. Also, we only have a change if the source ordinal is higher - if (currentValue.getValue() != null && !entry.getValue().getValue().equals(currentValue.getValue()) + // The config value can be null (for ex. if the property uses environment variables not available at build time) + if (currentValue.getValue() != null && !Objects.equals(entry.getValue().getValue(), currentValue.getValue()) && entry.getValue().getSourceOrdinal() < currentValue.getSourceOrdinal()) { mismatches.add( " - " + entry.getKey() + " is set to '" + currentValue.getValue() From d40a7209efcbdcb8fec5ff2a04181576c1edbd09 Mon Sep 17 00:00:00 2001 From: Alexey Loubyansky Date: Thu, 11 Jan 2024 10:56:14 +0100 Subject: [PATCH 11/12] [Gradle] make quarkusRun depend on quarkusBuild (cherry picked from commit 5d2923a67c6353f84f762d3148d90d0aa4c2f69e) --- .../src/main/java/io/quarkus/gradle/QuarkusPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java index a44fcfd3d8780..f6092185bfa9f 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java @@ -227,7 +227,8 @@ public boolean isSatisfiedBy(Task t) { TaskProvider quarkusDev = tasks.register(QUARKUS_DEV_TASK_NAME, QuarkusDev.class, devRuntimeDependencies, quarkusExt); - TaskProvider quarkusRun = tasks.register(QUARKUS_RUN_TASK_NAME, QuarkusRun.class); + TaskProvider quarkusRun = tasks.register(QUARKUS_RUN_TASK_NAME, QuarkusRun.class, + build -> build.dependsOn(quarkusBuild)); TaskProvider quarkusRemoteDev = tasks.register(QUARKUS_REMOTE_DEV_TASK_NAME, QuarkusRemoteDev.class, devRuntimeDependencies, quarkusExt); TaskProvider quarkusTest = tasks.register(QUARKUS_TEST_TASK_NAME, QuarkusTest.class, From 518d71f99d76858a656c73367aeb8437ef839cd3 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Mon, 15 Jan 2024 18:08:36 +0100 Subject: [PATCH 12/12] Fix a code example in RESTEasy Reactive doc Per report from @muditporwal in: https://github.com/quarkusio/quarkusio.github.io/pull/1866 (cherry picked from commit 40b0a65e5efffa01a47207720a402acb04e120fa) --- docs/src/main/asciidoc/resteasy-reactive.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/resteasy-reactive.adoc b/docs/src/main/asciidoc/resteasy-reactive.adoc index 5a4afac21f3d0..8faabcf584aad 100644 --- a/docs/src/main/asciidoc/resteasy-reactive.adoc +++ b/docs/src/main/asciidoc/resteasy-reactive.adoc @@ -1301,7 +1301,7 @@ public class Person { private final Long id; private final String first; private final String last; - @SecureField(rolesAllowed = ${role:admin}") <1> + @SecureField(rolesAllowed = "${role:admin}") <1> private String address; public Person(Long id, String first, String last) {