diff --git a/bom/application/pom.xml b/bom/application/pom.xml index cd014f6f13c87..7abedd4f9bdd8 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -2157,6 +2157,26 @@ quarkus-rest-client-reactive-jackson-deployment ${project.version} + + io.quarkus + quarkus-rest-client-reactive-jaxb + ${project.version} + + + io.quarkus + quarkus-rest-client-reactive-jaxb-deployment + ${project.version} + + + io.quarkus + quarkus-rest-client-reactive-jsonb + ${project.version} + + + io.quarkus + quarkus-rest-client-reactive-jsonb-deployment + ${project.version} + io.quarkus quarkus-resteasy-reactive-kotlin-serialization-common @@ -2197,6 +2217,16 @@ quarkus-resteasy-reactive-jsonb-deployment ${project.version} + + io.quarkus + quarkus-resteasy-reactive-jsonb-common + ${project.version} + + + io.quarkus + quarkus-resteasy-reactive-jsonb-common-deployment + ${project.version} + io.quarkus quarkus-resteasy-reactive-jaxb @@ -2207,6 +2237,16 @@ quarkus-resteasy-reactive-jaxb-deployment ${project.version} + + io.quarkus + quarkus-resteasy-reactive-jaxb-common + ${project.version} + + + io.quarkus + quarkus-resteasy-reactive-jaxb-common-deployment + ${project.version} + io.quarkus quarkus-resteasy-reactive-jackson diff --git a/core/deployment/src/main/java/io/quarkus/deployment/Feature.java b/core/deployment/src/main/java/io/quarkus/deployment/Feature.java index edc14515d8402..9240438668133 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/Feature.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/Feature.java @@ -104,6 +104,8 @@ public enum Feature { REST_CLIENT_MUTINY, REST_CLIENT_REACTIVE, REST_CLIENT_REACTIVE_JACKSON, + REST_CLIENT_REACTIVE_JAXB, + REST_CLIENT_REACTIVE_JSONB, REST_CLIENT_REACTIVE_KOTLIN_SERIALIZATION, SCALA, SCHEDULER, diff --git a/devtools/bom-descriptor-json/pom.xml b/devtools/bom-descriptor-json/pom.xml index fd19d18d966bb..6edfceaec3eec 100644 --- a/devtools/bom-descriptor-json/pom.xml +++ b/devtools/bom-descriptor-json/pom.xml @@ -1813,6 +1813,32 @@ + + io.quarkus + quarkus-rest-client-reactive-jaxb + ${project.version} + pom + test + + + * + * + + + + + io.quarkus + quarkus-rest-client-reactive-jsonb + ${project.version} + pom + test + + + * + * + + + io.quarkus quarkus-rest-client-reactive-kotlin-serialization @@ -2034,6 +2060,19 @@ + + io.quarkus + quarkus-resteasy-reactive-jaxb-common + ${project.version} + pom + test + + + * + * + + + io.quarkus quarkus-resteasy-reactive-jsonb @@ -2047,6 +2086,19 @@ + + io.quarkus + quarkus-resteasy-reactive-jsonb-common + ${project.version} + pom + test + + + * + * + + + io.quarkus quarkus-resteasy-reactive-kotlin diff --git a/devtools/bom-descriptor-json/src/main/resources/catalog-overrides.json b/devtools/bom-descriptor-json/src/main/resources/catalog-overrides.json index 46f888c07ce32..68490f0062d88 100644 --- a/devtools/bom-descriptor-json/src/main/resources/catalog-overrides.json +++ b/devtools/bom-descriptor-json/src/main/resources/catalog-overrides.json @@ -15,6 +15,8 @@ "io.quarkus:quarkus-resteasy-reactive-links", "io.quarkus:quarkus-rest-client-reactive", "io.quarkus:quarkus-rest-client-reactive-jackson", + "io.quarkus:quarkus-rest-client-reactive-jsonb", + "io.quarkus:quarkus-rest-client-reactive-jaxb", "io.quarkus:quarkus-rest-client-reactive-kotlin-serialization", "io.quarkus:quarkus-resteasy", "io.quarkus:quarkus-resteasy-jackson", diff --git a/docs/pom.xml b/docs/pom.xml index a2f3d883cb01a..8e9ba0e4e176e 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -1773,6 +1773,32 @@ + + io.quarkus + quarkus-rest-client-reactive-jaxb-deployment + ${project.version} + pom + test + + + * + * + + + + + io.quarkus + quarkus-rest-client-reactive-jsonb-deployment + ${project.version} + pom + test + + + * + * + + + io.quarkus quarkus-rest-client-reactive-kotlin-serialization-deployment @@ -1994,6 +2020,19 @@ + + io.quarkus + quarkus-resteasy-reactive-jaxb-common-deployment + ${project.version} + pom + test + + + * + * + + + io.quarkus quarkus-resteasy-reactive-jsonb-deployment @@ -2007,6 +2046,19 @@ + + io.quarkus + quarkus-resteasy-reactive-jsonb-common-deployment + ${project.version} + pom + test + + + * + * + + + io.quarkus quarkus-resteasy-reactive-kotlin-deployment diff --git a/extensions/resteasy-reactive/pom.xml b/extensions/resteasy-reactive/pom.xml index 36e776edae515..b801b8b0f8a7e 100644 --- a/extensions/resteasy-reactive/pom.xml +++ b/extensions/resteasy-reactive/pom.xml @@ -19,12 +19,16 @@ quarkus-resteasy-reactive-jackson quarkus-resteasy-reactive-jackson-common quarkus-resteasy-reactive-jsonb + quarkus-resteasy-reactive-jsonb-common quarkus-resteasy-reactive-jaxb + quarkus-resteasy-reactive-jaxb-common quarkus-resteasy-reactive-qute quarkus-resteasy-reactive-servlet jaxrs-client-reactive rest-client-reactive rest-client-reactive-jackson + rest-client-reactive-jsonb + rest-client-reactive-jaxb rest-client-reactive-kotlin-serialization quarkus-resteasy-reactive-links quarkus-resteasy-reactive-kotlin diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/deployment/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/deployment/pom.xml new file mode 100644 index 0000000000000..55ea124401427 --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/deployment/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + quarkus-resteasy-reactive-jaxb-common-parent + io.quarkus + 999-SNAPSHOT + + + quarkus-resteasy-reactive-jaxb-common-deployment + Quarkus - RESTEasy Reactive - JAXB Common Bits - Deployment + + + + io.quarkus + quarkus-resteasy-reactive-common-deployment + + + io.quarkus + quarkus-jaxb-deployment + + + io.quarkus + quarkus-resteasy-reactive-jaxb-common + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/deployment/processor/ResteasyReactiveJaxbProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/deployment/ResteasyReactiveJaxbCommonProcessor.java similarity index 71% rename from extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/deployment/processor/ResteasyReactiveJaxbProcessor.java rename to extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/deployment/ResteasyReactiveJaxbCommonProcessor.java index 0dbe028e48100..4d9d1311fb9a5 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/deployment/processor/ResteasyReactiveJaxbProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/deployment/ResteasyReactiveJaxbCommonProcessor.java @@ -1,25 +1,18 @@ -package io.quarkus.resteasy.reactive.jaxb.deployment.processor; +package io.quarkus.resteasy.reactive.jaxb.common.deployment; import java.util.Collections; import javax.ws.rs.core.MediaType; import io.quarkus.arc.deployment.AdditionalBeanBuildItem; -import io.quarkus.deployment.Feature; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.resteasy.reactive.jaxb.runtime.serialisers.JaxbMessageBodyReader; -import io.quarkus.resteasy.reactive.jaxb.runtime.serialisers.JaxbMessageBodyWriter; +import io.quarkus.resteasy.reactive.jaxb.common.runtime.serialisers.JaxbMessageBodyReader; +import io.quarkus.resteasy.reactive.jaxb.common.runtime.serialisers.JaxbMessageBodyWriter; import io.quarkus.resteasy.reactive.spi.MessageBodyReaderBuildItem; import io.quarkus.resteasy.reactive.spi.MessageBodyWriterBuildItem; -public class ResteasyReactiveJaxbProcessor { - - @BuildStep - void feature(BuildProducer feature) { - feature.produce(new FeatureBuildItem(Feature.RESTEASY_REACTIVE_JAXB)); - } +public class ResteasyReactiveJaxbCommonProcessor { @BuildStep void additionalProviders(BuildProducer additionalBean, diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/pom.xml new file mode 100644 index 0000000000000..b5c858c4019b4 --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/pom.xml @@ -0,0 +1,20 @@ + + + + quarkus-resteasy-reactive-parent-aggregator + io.quarkus + 999-SNAPSHOT + ../pom.xml + + 4.0.0 + + quarkus-resteasy-reactive-jaxb-common-parent + Quarkus - RESTEasy Reactive - JAXB Common Bits + pom + + deployment + runtime + + diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/pom.xml new file mode 100644 index 0000000000000..42447f6f33017 --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + quarkus-resteasy-reactive-jaxb-common-parent + io.quarkus + 999-SNAPSHOT + + + quarkus-resteasy-reactive-jaxb-common + Quarkus - RESTEasy Reactive - JAXB Common Bits- Runtime + Common classes for JAXB serialization support for RESTEasy Reactive + + + + io.quarkus + quarkus-resteasy-reactive-common + + + io.quarkus.resteasy.reactive + resteasy-reactive + + + io.quarkus + quarkus-jaxb + + + + + + + io.quarkus + quarkus-bootstrap-maven-plugin + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + + + diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/runtime/serialisers/JaxbMessageBodyReader.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/runtime/serialisers/JaxbMessageBodyReader.java similarity index 97% rename from extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/runtime/serialisers/JaxbMessageBodyReader.java rename to extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/runtime/serialisers/JaxbMessageBodyReader.java index 1b5c7f7740034..cfcf2102893a3 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/runtime/serialisers/JaxbMessageBodyReader.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/runtime/serialisers/JaxbMessageBodyReader.java @@ -1,4 +1,4 @@ -package io.quarkus.resteasy.reactive.jaxb.runtime.serialisers; +package io.quarkus.resteasy.reactive.jaxb.common.runtime.serialisers; import java.io.IOException; import java.io.InputStream; diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/runtime/serialisers/JaxbMessageBodyWriter.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/runtime/serialisers/JaxbMessageBodyWriter.java similarity index 97% rename from extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/runtime/serialisers/JaxbMessageBodyWriter.java rename to extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/runtime/serialisers/JaxbMessageBodyWriter.java index c94eefec77d16..cae0eca61dc5f 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/runtime/serialisers/JaxbMessageBodyWriter.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jaxb/common/runtime/serialisers/JaxbMessageBodyWriter.java @@ -1,4 +1,4 @@ -package io.quarkus.resteasy.reactive.jaxb.runtime.serialisers; +package io.quarkus.resteasy.reactive.jaxb.common.runtime.serialisers; import java.io.IOException; import java.io.OutputStream; diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000000000..4c214c3c90d6e --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb-common/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,4 @@ +name: "RESTEasy Reactive JAXB Common" +artifact: ${project.groupId}:${project.artifactId}:${project.version} +metadata: + unlisted: true diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/pom.xml index f5a1d5563e636..c24cfe649b565 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/pom.xml @@ -19,7 +19,7 @@ io.quarkus - quarkus-jaxb-deployment + quarkus-resteasy-reactive-jaxb-common-deployment io.quarkus diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/deployment/ResteasyReactiveJaxbProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/deployment/ResteasyReactiveJaxbProcessor.java new file mode 100644 index 0000000000000..794feb434126e --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/deployment/src/main/java/io/quarkus/resteasy/reactive/jaxb/deployment/ResteasyReactiveJaxbProcessor.java @@ -0,0 +1,14 @@ +package io.quarkus.resteasy.reactive.jaxb.deployment; + +import io.quarkus.deployment.Feature; +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; + +public class ResteasyReactiveJaxbProcessor { + + @BuildStep + void feature(BuildProducer feature) { + feature.produce(new FeatureBuildItem(Feature.RESTEASY_REACTIVE_JAXB)); + } +} diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/pom.xml index ff0fd7889a58a..2ca271ce89ef9 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jaxb/runtime/pom.xml @@ -20,7 +20,7 @@ io.quarkus - quarkus-jaxb + quarkus-resteasy-reactive-jaxb-common diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/deployment/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/deployment/pom.xml new file mode 100644 index 0000000000000..7b2184803c5e0 --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/deployment/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + quarkus-resteasy-reactive-jsonb-common-parent + io.quarkus + 999-SNAPSHOT + + + quarkus-resteasy-reactive-jsonb-common-deployment + Quarkus - RESTEasy Reactive - JSON-B Common Bits - Deployment + + + + io.quarkus + quarkus-resteasy-reactive-common-deployment + + + io.quarkus + quarkus-jsonb-deployment + + + io.quarkus + quarkus-resteasy-reactive-jsonb-common + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/deployment/processor/ResteasyReactiveJsonbProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/deployment/ResteasyReactiveJsonbCommonProcessor.java similarity index 78% rename from extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/deployment/processor/ResteasyReactiveJsonbProcessor.java rename to extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/deployment/ResteasyReactiveJsonbCommonProcessor.java index d9af2a611b97b..5b778b284f4b8 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/deployment/processor/ResteasyReactiveJsonbProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/deployment/ResteasyReactiveJsonbCommonProcessor.java @@ -1,4 +1,4 @@ -package io.quarkus.resteasy.reactive.jsonb.deployment.processor; +package io.quarkus.resteasy.reactive.jsonb.common.deployment; import java.util.Collections; import java.util.List; @@ -10,18 +10,15 @@ import org.jboss.resteasy.reactive.server.jsonb.JsonbMessageBodyWriter; import io.quarkus.arc.deployment.AdditionalBeanBuildItem; -import io.quarkus.deployment.Feature; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.jsonb.spi.JsonbDeserializerBuildItem; import io.quarkus.jsonb.spi.JsonbSerializerBuildItem; -import io.quarkus.resteasy.reactive.common.deployment.ServerDefaultProducesHandlerBuildItem; -import io.quarkus.resteasy.reactive.jsonb.runtime.serialisers.vertx.VertxJson; +import io.quarkus.resteasy.reactive.jsonb.common.runtime.serialisers.VertxJson; import io.quarkus.resteasy.reactive.spi.MessageBodyReaderBuildItem; import io.quarkus.resteasy.reactive.spi.MessageBodyWriterBuildItem; -public class ResteasyReactiveJsonbProcessor { +public class ResteasyReactiveJsonbCommonProcessor { private static final List VERTX_SERIALIZERS = List.of( VertxJson.JsonObjectSerializer.class.getName(), @@ -31,16 +28,6 @@ public class ResteasyReactiveJsonbProcessor { VertxJson.JsonObjectDeserializer.class.getName(), VertxJson.JsonArrayDeserializer.class.getName()); - @BuildStep - void feature(BuildProducer feature) { - feature.produce(new FeatureBuildItem(Feature.RESTEASY_REACTIVE_JSONB)); - } - - @BuildStep - ServerDefaultProducesHandlerBuildItem jsonDefault() { - return ServerDefaultProducesHandlerBuildItem.json(); - } - @BuildStep void additionalProviders(BuildProducer additionalBean, BuildProducer additionalReaders, diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/pom.xml new file mode 100644 index 0000000000000..6e9584f0e01bb --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/pom.xml @@ -0,0 +1,20 @@ + + + + quarkus-resteasy-reactive-parent-aggregator + io.quarkus + 999-SNAPSHOT + ../pom.xml + + 4.0.0 + + quarkus-resteasy-reactive-jsonb-common-parent + Quarkus - RESTEasy Reactive - JSON-B Common Bits + pom + + deployment + runtime + + diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/pom.xml new file mode 100644 index 0000000000000..0baa142ee09a5 --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + quarkus-resteasy-reactive-jsonb-common-parent + io.quarkus + 999-SNAPSHOT + + + quarkus-resteasy-reactive-jsonb-common + Quarkus - RESTEasy Reactive - JSON-B Common Bits - Runtime + Common classes for JSON-B serialization support for RESTEasy Reactive + + + + io.quarkus + quarkus-resteasy-reactive-common + + + io.quarkus.resteasy.reactive + resteasy-reactive-jsonb + + + io.quarkus + quarkus-jsonb + + + + + + + io.quarkus + quarkus-bootstrap-maven-plugin + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + + + diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/runtime/serialisers/vertx/VertxJson.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/runtime/serialisers/VertxJson.java similarity index 98% rename from extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/runtime/serialisers/vertx/VertxJson.java rename to extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/runtime/serialisers/VertxJson.java index 73d567587aaf1..b1a8a23f76085 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/runtime/serialisers/vertx/VertxJson.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/src/main/java/io/quarkus/resteasy/reactive/jsonb/common/runtime/serialisers/VertxJson.java @@ -1,4 +1,4 @@ -package io.quarkus.resteasy.reactive.jsonb.runtime.serialisers.vertx; +package io.quarkus.resteasy.reactive.jsonb.common.runtime.serialisers; import java.lang.reflect.Type; diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000000000..43181aaae6940 --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb-common/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,4 @@ +name: "RESTEasy Reactive JSON-B Common" +artifact: ${project.groupId}:${project.artifactId}:${project.version} +metadata: + unlisted: true \ No newline at end of file diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/pom.xml index 7cf20c30051c8..bd806d2c4de42 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/pom.xml @@ -19,7 +19,7 @@ io.quarkus - quarkus-jsonb-deployment + quarkus-resteasy-reactive-jsonb-common-deployment io.quarkus diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/deployment/ResteasyReactiveJsonbProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/deployment/ResteasyReactiveJsonbProcessor.java new file mode 100644 index 0000000000000..a674d8d89bdfa --- /dev/null +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment/src/main/java/io/quarkus/resteasy/reactive/jsonb/deployment/ResteasyReactiveJsonbProcessor.java @@ -0,0 +1,20 @@ +package io.quarkus.resteasy.reactive.jsonb.deployment; + +import io.quarkus.deployment.Feature; +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.resteasy.reactive.common.deployment.ServerDefaultProducesHandlerBuildItem; + +public class ResteasyReactiveJsonbProcessor { + + @BuildStep + void feature(BuildProducer feature) { + feature.produce(new FeatureBuildItem(Feature.RESTEASY_REACTIVE_JSONB)); + } + + @BuildStep + ServerDefaultProducesHandlerBuildItem jsonDefault() { + return ServerDefaultProducesHandlerBuildItem.json(); + } +} diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/pom.xml index 029fcea11a765..8b45d81f02d48 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/runtime/pom.xml @@ -24,7 +24,7 @@ io.quarkus - quarkus-jsonb + quarkus-resteasy-reactive-jsonb-common diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java index 20a317fe52546..16b6355c47190 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java @@ -169,7 +169,7 @@ private void warnAboutMissingJsonProviderIfNeeded(ServerResourceMethod method, M if (!capabilities.isCapabilityWithPrefixMissing("io.quarkus.resteasy.reactive.json")) { return; } - if (hasJson(method) || isDefaultJson()) { + if (hasJson(method) || (hasNoTypesDefined(method) && isDefaultJson())) { LOGGER.warnf("Quarkus detected the use of JSON in JAX-RS method '" + info.declaringClass().name() + "#" + info.name() + "' but no JSON extension has been added. Consider adding 'quarkus-resteasy-reactive-jackson' or 'quarkus-resteasy-reactive-jsonb'."); @@ -190,6 +190,12 @@ private boolean hasJson(ServerResourceMethod method) { return hasJson(method.getProduces()) || hasJson(method.getConsumes()) || isJson(method.getStreamElementType()); } + private boolean hasNoTypesDefined(ServerResourceMethod method) { + return (method.getProduces() == null || method.getProduces().length == 0) && + (method.getConsumes() == null || method.getConsumes().length == 0) && + (method.getStreamElementType() == null); + } + private boolean hasJson(String[] types) { if (types == null) { return false; diff --git a/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/pom.xml b/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/pom.xml new file mode 100644 index 0000000000000..03a6b64ff56eb --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/pom.xml @@ -0,0 +1,66 @@ + + + 4.0.0 + + quarkus-rest-client-reactive-jaxb-parent + io.quarkus + 999-SNAPSHOT + + quarkus-rest-client-reactive-jaxb-deployment + Quarkus - REST Client Reactive JAXB - Deployment + + + io.quarkus + quarkus-resteasy-reactive-jaxb-common-deployment + + + io.quarkus + quarkus-rest-client-reactive-deployment + + + io.quarkus + quarkus-rest-client-reactive-jaxb + + + + + io.quarkus + quarkus-resteasy-reactive-jaxb-deployment + test + + + io.quarkus + quarkus-junit5-internal + test + + + io.rest-assured + rest-assured + test + + + org.assertj + assertj-core + test + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + diff --git a/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/src/main/java/io/quarkus/rest/client/reactive/jaxb/deployment/RestClientReactiveJaxbProcessor.java b/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/src/main/java/io/quarkus/rest/client/reactive/jaxb/deployment/RestClientReactiveJaxbProcessor.java new file mode 100644 index 0000000000000..9272ab2e635db --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/src/main/java/io/quarkus/rest/client/reactive/jaxb/deployment/RestClientReactiveJaxbProcessor.java @@ -0,0 +1,15 @@ +package io.quarkus.rest.client.reactive.jaxb.deployment; + +import static io.quarkus.deployment.Feature.REST_CLIENT_REACTIVE_JAXB; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; + +public class RestClientReactiveJaxbProcessor { + + @BuildStep + void feature(BuildProducer features) { + features.produce(new FeatureBuildItem(REST_CLIENT_REACTIVE_JAXB)); + } +} diff --git a/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/src/test/java/io/quarkus/rest/client/reactive/jaxb/test/SimpleJaxbTest.java b/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/src/test/java/io/quarkus/rest/client/reactive/jaxb/test/SimpleJaxbTest.java new file mode 100644 index 0000000000000..54bd22dd37215 --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jaxb/deployment/src/test/java/io/quarkus/rest/client/reactive/jaxb/test/SimpleJaxbTest.java @@ -0,0 +1,82 @@ +package io.quarkus.rest.client.reactive.jaxb.test; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.net.URI; +import java.util.Objects; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusUnitTest; +import io.quarkus.test.common.http.TestHTTPResource; + +public class SimpleJaxbTest { + @RegisterExtension + static final QuarkusUnitTest TEST = new QuarkusUnitTest() + .withEmptyApplication(); + + @TestHTTPResource + URI uri; + + @Test + void shouldConsumeJsonEntity() { + var dto = RestClientBuilder.newBuilder().baseUri(uri).build(XmlClient.class) + .dto(); + assertThat(dto).isEqualTo(new Dto("foo", "bar")); + } + + @Path("/xml") + public interface XmlClient { + + @GET + @Path("/dto") + @Produces(MediaType.APPLICATION_XML) + Dto dto(); + } + + @Path("/xml") + public static class XmlResource { + + @GET + @Produces(MediaType.APPLICATION_XML) + @Path("/dto") + public Dto dto() { + return new Dto("foo", "bar"); + } + } + + public static class Dto { + public String name; + public String value; + + public Dto(String name, String value) { + this.name = name; + this.value = value; + } + + public Dto() { + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Dto dto = (Dto) o; + return Objects.equals(name, dto.name) && Objects.equals(value, dto.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + } +} diff --git a/extensions/resteasy-reactive/rest-client-reactive-jaxb/pom.xml b/extensions/resteasy-reactive/rest-client-reactive-jaxb/pom.xml new file mode 100644 index 0000000000000..1199ebc7154d9 --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jaxb/pom.xml @@ -0,0 +1,20 @@ + + + + quarkus-resteasy-reactive-parent-aggregator + io.quarkus + 999-SNAPSHOT + ../pom.xml + + 4.0.0 + + quarkus-rest-client-reactive-jaxb-parent + Quarkus - REST Client Reactive JAXB + pom + + deployment + runtime + + diff --git a/extensions/resteasy-reactive/rest-client-reactive-jaxb/runtime/pom.xml b/extensions/resteasy-reactive/rest-client-reactive-jaxb/runtime/pom.xml new file mode 100644 index 0000000000000..640ed96020bd1 --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jaxb/runtime/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + quarkus-rest-client-reactive-jaxb-parent + io.quarkus + 999-SNAPSHOT + + quarkus-rest-client-reactive-jaxb + Quarkus - REST Client Reactive JAXB + JAXB serialization support for REST Client Reactive + + + + io.quarkus + quarkus-resteasy-reactive-jaxb-common + + + io.quarkus + quarkus-rest-client-reactive + + + + + + + io.quarkus + quarkus-bootstrap-maven-plugin + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + + + diff --git a/extensions/resteasy-reactive/rest-client-reactive-jaxb/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/rest-client-reactive-jaxb/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000000000..b037f6b26d7a1 --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jaxb/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,26 @@ +--- +artifact: ${project.groupId}:${project.artifactId}:${project.version} +name: "REST Client Reactive JAXB" +metadata: + keywords: + - "rest-client-jaxb" + - "rest-client" + - "web-client" + - "microprofile-rest-client" + - "jaxb" + - "xml" + - "resteasy-reactive" + categories: + - "web" + - "serialization" + status: "stable" + codestart: + name: "resteasy-reactive" + kind: "core" + languages: + - "java" + - "kotlin" + - "scala" + artifact: "io.quarkus:quarkus-project-core-extension-codestarts" + config: + - "quarkus.rest-client-reactive." diff --git a/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/pom.xml b/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/pom.xml new file mode 100644 index 0000000000000..9fd386e318fec --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/pom.xml @@ -0,0 +1,66 @@ + + + 4.0.0 + + quarkus-rest-client-reactive-jsonb-parent + io.quarkus + 999-SNAPSHOT + + quarkus-rest-client-reactive-jsonb-deployment + Quarkus - REST Client Reactive JSON-B - Deployment + + + io.quarkus + quarkus-resteasy-reactive-jsonb-common-deployment + + + io.quarkus + quarkus-rest-client-reactive-deployment + + + io.quarkus + quarkus-rest-client-reactive-jsonb + + + + + io.quarkus + quarkus-resteasy-reactive-jsonb-deployment + test + + + io.quarkus + quarkus-junit5-internal + test + + + io.rest-assured + rest-assured + test + + + org.assertj + assertj-core + test + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + diff --git a/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/src/main/java/io/quarkus/rest/client/reactive/jsonb/deployment/RestClientReactiveJsonbProcessor.java b/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/src/main/java/io/quarkus/rest/client/reactive/jsonb/deployment/RestClientReactiveJsonbProcessor.java new file mode 100644 index 0000000000000..533c8f0cbc812 --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/src/main/java/io/quarkus/rest/client/reactive/jsonb/deployment/RestClientReactiveJsonbProcessor.java @@ -0,0 +1,15 @@ +package io.quarkus.rest.client.reactive.jsonb.deployment; + +import static io.quarkus.deployment.Feature.REST_CLIENT_REACTIVE_JSONB; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; + +public class RestClientReactiveJsonbProcessor { + + @BuildStep + void feature(BuildProducer features) { + features.produce(new FeatureBuildItem(REST_CLIENT_REACTIVE_JSONB)); + } +} diff --git a/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/src/test/java/io/quarkus/rest/client/reactive/jsonb/test/SimpleJsonbTest.java b/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/src/test/java/io/quarkus/rest/client/reactive/jsonb/test/SimpleJsonbTest.java new file mode 100644 index 0000000000000..3f77b707afc74 --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jsonb/deployment/src/test/java/io/quarkus/rest/client/reactive/jsonb/test/SimpleJsonbTest.java @@ -0,0 +1,83 @@ +package io.quarkus.rest.client.reactive.jsonb.test; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.net.URI; +import java.util.List; +import java.util.Objects; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusUnitTest; +import io.quarkus.test.common.http.TestHTTPResource; + +public class SimpleJsonbTest { + @RegisterExtension + static final QuarkusUnitTest TEST = new QuarkusUnitTest() + .withEmptyApplication(); + + @TestHTTPResource + URI uri; + + @Test + void shouldConsumeJsonEntity() { + var resultList = RestClientBuilder.newBuilder().baseUri(uri).build(JsonClient.class) + .listDtos(); + assertThat(resultList).containsExactly(new Dto("foo", "bar"), new Dto("chocolate", "bar")); + } + + @Path("/json") + public interface JsonClient { + + @GET + @Path("/list-dtos") + @Produces(MediaType.APPLICATION_JSON) + List listDtos(); + } + + @Path("/json") + public static class JsonResource { + + @GET + @Produces(MediaType.APPLICATION_JSON) + @Path("/list-dtos") + public List listDtos() { + return List.of(new Dto("foo", "bar"), new Dto("chocolate", "bar")); + } + } + + public static class Dto { + public String name; + public String value; + + public Dto(String name, String value) { + this.name = name; + this.value = value; + } + + public Dto() { + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Dto dto = (Dto) o; + return Objects.equals(name, dto.name) && Objects.equals(value, dto.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + } +} diff --git a/extensions/resteasy-reactive/rest-client-reactive-jsonb/pom.xml b/extensions/resteasy-reactive/rest-client-reactive-jsonb/pom.xml new file mode 100644 index 0000000000000..e8eb5610ca92c --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jsonb/pom.xml @@ -0,0 +1,20 @@ + + + + quarkus-resteasy-reactive-parent-aggregator + io.quarkus + 999-SNAPSHOT + ../pom.xml + + 4.0.0 + + quarkus-rest-client-reactive-jsonb-parent + Quarkus - REST Client Reactive JSON-B + pom + + deployment + runtime + + diff --git a/extensions/resteasy-reactive/rest-client-reactive-jsonb/runtime/pom.xml b/extensions/resteasy-reactive/rest-client-reactive-jsonb/runtime/pom.xml new file mode 100644 index 0000000000000..b18833c6ae622 --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jsonb/runtime/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + quarkus-rest-client-reactive-jsonb-parent + io.quarkus + 999-SNAPSHOT + + quarkus-rest-client-reactive-jsonb + Quarkus - REST Client Reactive JSON-B + JSON-B serialization support for REST Client Reactive + + + + io.quarkus.resteasy.reactive + resteasy-reactive-jsonb + + + io.quarkus + quarkus-resteasy-reactive-jsonb-common + + + io.quarkus + quarkus-rest-client-reactive + + + + + + + io.quarkus + quarkus-bootstrap-maven-plugin + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + + + diff --git a/extensions/resteasy-reactive/rest-client-reactive-jsonb/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/rest-client-reactive-jsonb/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000000000..7db94373e489d --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive-jsonb/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,26 @@ +--- +artifact: ${project.groupId}:${project.artifactId}:${project.version} +name: "REST Client Reactive JSON-B" +metadata: + keywords: + - "rest-client-jsonb" + - "rest-client" + - "web-client" + - "microprofile-rest-client" + - "json" + - "jsonb" + - "resteasy-reactive" + categories: + - "web" + - "serialization" + status: "stable" + codestart: + name: "resteasy-reactive" + kind: "core" + languages: + - "java" + - "kotlin" + - "scala" + artifact: "io.quarkus:quarkus-project-core-extension-codestarts" + config: + - "quarkus.rest-client-reactive."