From ad96240fc35dace715bea7a2e119a925d7ea18e7 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 15 Mar 2019 18:37:22 +0100 Subject: [PATCH] Introduce JSON-B and JSON-P extensions I haven't added a FeatureBuildItem as I don't think they are worth an item in the feature list at startup. Fixes #1480 and #1482 and a few other issues in passing. --- bom/pom.xml | 42 +++++++++++++++- build-parent/pom.xml | 23 +++++++++ .../common/src/main/filtered/extensions.json | 20 ++++++++ extensions/jsonb/deployment/pom.xml | 48 ++++++++++++++++++ .../jsonb/deployment/JsonbProcessor.java | 35 +++++++++++++ extensions/jsonb/pom.xml | 20 ++++++++ extensions/jsonb/runtime/pom.xml | 50 +++++++++++++++++++ extensions/jsonp/deployment/pom.xml | 44 ++++++++++++++++ .../jsonp/deployment/JsonpProcessor.java | 34 +++++++++++++ extensions/jsonp/pom.xml | 20 ++++++++ extensions/jsonp/runtime/pom.xml | 46 +++++++++++++++++ extensions/pom.xml | 4 ++ extensions/resteasy-jsonb/deployment/pom.xml | 4 ++ .../deployment/ResteasyJsonbProcessor.java | 11 +--- extensions/resteasy-jsonb/runtime/pom.xml | 4 ++ extensions/smallrye-health/deployment/pom.xml | 4 ++ extensions/smallrye-health/runtime/pom.xml | 4 +- extensions/smallrye-jwt/deployment/pom.xml | 4 ++ extensions/smallrye-jwt/runtime/pom.xml | 4 +- .../smallrye-metrics/deployment/pom.xml | 4 ++ extensions/smallrye-metrics/runtime/pom.xml | 4 +- .../smallrye-opentracing/deployment/pom.xml | 8 +-- .../smallrye-opentracing/runtime/pom.xml | 5 +- integration-tests/main/pom.xml | 4 -- test-framework/common/pom.xml | 4 +- 25 files changed, 417 insertions(+), 33 deletions(-) create mode 100644 extensions/jsonb/deployment/pom.xml create mode 100755 extensions/jsonb/deployment/src/main/java/io/quarkus/jsonb/deployment/JsonbProcessor.java create mode 100644 extensions/jsonb/pom.xml create mode 100644 extensions/jsonb/runtime/pom.xml create mode 100644 extensions/jsonp/deployment/pom.xml create mode 100755 extensions/jsonp/deployment/src/main/java/io/quarkus/jsonp/deployment/JsonpProcessor.java create mode 100644 extensions/jsonp/pom.xml create mode 100644 extensions/jsonp/runtime/pom.xml diff --git a/bom/pom.xml b/bom/pom.xml index 29693932b9a81..de510ac95d6e4 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -143,6 +143,8 @@ 1.6.5 1.0.2 9.4.15.v20190215 + 1.0.3 + 1.1.5 @@ -196,6 +198,18 @@ ${project.version} provided + + io.quarkus + quarkus-jsonb + ${project.version} + provided + + + io.quarkus + quarkus-jsonp + ${project.version} + provided + io.quarkus quarkus-netty @@ -1033,10 +1047,15 @@ microprofile-rest-client-api ${microprofile-rest-client.version} + + org.eclipse + yasson + ${yasson.version} + org.glassfish - javax.json - ${javax.json.version} + jakarta.json + ${jakarta.json.version} org.glassfish.jaxb @@ -1193,6 +1212,25 @@ javax.json javax.json-api + + org.glassfish + javax.json + + + javax.json.bind + javax.json.bind-api + + + + + org.jboss.resteasy + resteasy-json-p-provider + ${resteasy.version} + + + org.glassfish + javax.json + diff --git a/build-parent/pom.xml b/build-parent/pom.xml index 7aea94666e11d..57018f478155c 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -140,6 +140,26 @@ quarkus-jaxb-runtime ${project.version} + + io.quarkus + quarkus-jsonb + ${project.version} + + + io.quarkus + quarkus-jsonb-runtime + ${project.version} + + + io.quarkus + quarkus-jsonp + ${project.version} + + + io.quarkus + quarkus-jsonp-runtime + ${project.version} + io.quarkus quarkus-netty @@ -670,6 +690,9 @@ org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec javax.json:javax.json-api + + org.glassfish:javax.json + javax.json.bind:javax.json.bind-api diff --git a/devtools/common/src/main/filtered/extensions.json b/devtools/common/src/main/filtered/extensions.json index 6f49a33a10885..bedc1449c3acb 100644 --- a/devtools/common/src/main/filtered/extensions.json +++ b/devtools/common/src/main/filtered/extensions.json @@ -126,6 +126,26 @@ "groupId": "io.quarkus", "artifactId": "quarkus-jdbc-postgresql" }, + { + "name": "JSON-B", + "labels": [ + "jsonb", + "json-b", + "json" + ], + "groupId": "io.quarkus", + "artifactId": "quarkus-jsonb" + }, + { + "name": "JSON-P", + "labels": [ + "jsonp", + "json-p", + "json" + ], + "groupId": "io.quarkus", + "artifactId": "quarkus-jsonp" + }, { "name": "Kotlin", "labels": [ diff --git a/extensions/jsonb/deployment/pom.xml b/extensions/jsonb/deployment/pom.xml new file mode 100644 index 0000000000000..e5dd5d289b39b --- /dev/null +++ b/extensions/jsonb/deployment/pom.xml @@ -0,0 +1,48 @@ + + + + quarkus-jsonb-parent + io.quarkus + 999-SNAPSHOT + ../ + + 4.0.0 + + quarkus-jsonb + Quarkus - JSON-B - Deployment + + + + io.quarkus + quarkus-core + + + io.quarkus + quarkus-jsonp + + + io.quarkus + quarkus-jsonb-runtime + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + + diff --git a/extensions/jsonb/deployment/src/main/java/io/quarkus/jsonb/deployment/JsonbProcessor.java b/extensions/jsonb/deployment/src/main/java/io/quarkus/jsonb/deployment/JsonbProcessor.java new file mode 100755 index 0000000000000..727b6894b4b8b --- /dev/null +++ b/extensions/jsonb/deployment/src/main/java/io/quarkus/jsonb/deployment/JsonbProcessor.java @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.quarkus.jsonb.deployment; + +import org.eclipse.yasson.JsonBindingProvider; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; +import io.quarkus.deployment.builditem.substrate.SubstrateResourceBundleBuildItem; + +public class JsonbProcessor { + + @BuildStep + void build(BuildProducer reflectiveClass, + BuildProducer resourceBundle) { + reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, + JsonBindingProvider.class.getName())); + + resourceBundle.produce(new SubstrateResourceBundleBuildItem("yasson-messages")); + } +} diff --git a/extensions/jsonb/pom.xml b/extensions/jsonb/pom.xml new file mode 100644 index 0000000000000..b7d000623493d --- /dev/null +++ b/extensions/jsonb/pom.xml @@ -0,0 +1,20 @@ + + + + quarkus-build-parent + io.quarkus + 999-SNAPSHOT + ../../build-parent/pom.xml + + 4.0.0 + + quarkus-jsonb-parent + Quarkus - JSON-B + pom + + deployment + runtime + + diff --git a/extensions/jsonb/runtime/pom.xml b/extensions/jsonb/runtime/pom.xml new file mode 100644 index 0000000000000..7ddf5ae6c471c --- /dev/null +++ b/extensions/jsonb/runtime/pom.xml @@ -0,0 +1,50 @@ + + + + quarkus-jsonb-parent + io.quarkus + 999-SNAPSHOT + ../ + + 4.0.0 + + quarkus-jsonb-runtime + Quarkus - JSON-B - Runtime + + + + org.eclipse + yasson + + + io.quarkus + quarkus-core-runtime + + + io.quarkus + quarkus-jsonp-runtime + + + + + + + maven-dependency-plugin + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + diff --git a/extensions/jsonp/deployment/pom.xml b/extensions/jsonp/deployment/pom.xml new file mode 100644 index 0000000000000..319b24f1696e7 --- /dev/null +++ b/extensions/jsonp/deployment/pom.xml @@ -0,0 +1,44 @@ + + + + quarkus-jsonp-parent + io.quarkus + 999-SNAPSHOT + ../ + + 4.0.0 + + quarkus-jsonp + Quarkus - JSON-P - Deployment + + + + io.quarkus + quarkus-core + + + io.quarkus + quarkus-jsonp-runtime + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + + diff --git a/extensions/jsonp/deployment/src/main/java/io/quarkus/jsonp/deployment/JsonpProcessor.java b/extensions/jsonp/deployment/src/main/java/io/quarkus/jsonp/deployment/JsonpProcessor.java new file mode 100755 index 0000000000000..da431d29319c1 --- /dev/null +++ b/extensions/jsonp/deployment/src/main/java/io/quarkus/jsonp/deployment/JsonpProcessor.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.quarkus.jsonp.deployment; + +import org.glassfish.json.JsonProviderImpl; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; +import io.quarkus.deployment.builditem.substrate.SubstrateResourceBundleBuildItem; + +public class JsonpProcessor { + + @BuildStep + void build(BuildProducer feature, + BuildProducer reflectiveClass, + BuildProducer resourceBundle) { + reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, JsonProviderImpl.class.getName())); + } +} diff --git a/extensions/jsonp/pom.xml b/extensions/jsonp/pom.xml new file mode 100644 index 0000000000000..7674aac523727 --- /dev/null +++ b/extensions/jsonp/pom.xml @@ -0,0 +1,20 @@ + + + + quarkus-build-parent + io.quarkus + 999-SNAPSHOT + ../../build-parent/pom.xml + + 4.0.0 + + quarkus-jsonp-parent + Quarkus - JSON-P + pom + + deployment + runtime + + diff --git a/extensions/jsonp/runtime/pom.xml b/extensions/jsonp/runtime/pom.xml new file mode 100644 index 0000000000000..120e47abc116f --- /dev/null +++ b/extensions/jsonp/runtime/pom.xml @@ -0,0 +1,46 @@ + + + + quarkus-jsonp-parent + io.quarkus + 999-SNAPSHOT + ../ + + 4.0.0 + + quarkus-jsonp-runtime + Quarkus - JSON-P - Runtime + + + + io.quarkus + quarkus-core-runtime + + + org.glassfish + jakarta.json + + + + + + + maven-dependency-plugin + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${project.version} + + + + + + + diff --git a/extensions/pom.xml b/extensions/pom.xml index 276ad763cbabd..ba9d72b766a99 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -33,7 +33,11 @@ arc scheduler + + jaxb + jsonp + jsonb undertow diff --git a/extensions/resteasy-jsonb/deployment/pom.xml b/extensions/resteasy-jsonb/deployment/pom.xml index e6fe935305d9d..336e2671af242 100644 --- a/extensions/resteasy-jsonb/deployment/pom.xml +++ b/extensions/resteasy-jsonb/deployment/pom.xml @@ -38,6 +38,10 @@ io.quarkus quarkus-resteasy-jsonb-runtime + + io.quarkus + quarkus-jsonb + diff --git a/extensions/resteasy-jsonb/deployment/src/main/java/io/quarkus/resteasy/jsonb/deployment/ResteasyJsonbProcessor.java b/extensions/resteasy-jsonb/deployment/src/main/java/io/quarkus/resteasy/jsonb/deployment/ResteasyJsonbProcessor.java index 92e7fe57d0c9f..07be69d6dc02f 100755 --- a/extensions/resteasy-jsonb/deployment/src/main/java/io/quarkus/resteasy/jsonb/deployment/ResteasyJsonbProcessor.java +++ b/extensions/resteasy-jsonb/deployment/src/main/java/io/quarkus/resteasy/jsonb/deployment/ResteasyJsonbProcessor.java @@ -15,23 +15,14 @@ */ package io.quarkus.resteasy.jsonb.deployment; -import org.eclipse.yasson.JsonBindingProvider; -import org.glassfish.json.JsonProviderImpl; - import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; public class ResteasyJsonbProcessor { @BuildStep - void build(BuildProducer feature, - BuildProducer reflectiveClass) { + void build(BuildProducer feature) { feature.produce(new FeatureBuildItem(FeatureBuildItem.RESTEASY_JSONB)); - - reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, - JsonBindingProvider.class.getName(), - JsonProviderImpl.class.getName())); } } diff --git a/extensions/resteasy-jsonb/runtime/pom.xml b/extensions/resteasy-jsonb/runtime/pom.xml index 353cfead93894..4cbf99c3d3e06 100644 --- a/extensions/resteasy-jsonb/runtime/pom.xml +++ b/extensions/resteasy-jsonb/runtime/pom.xml @@ -34,6 +34,10 @@ io.quarkus quarkus-resteasy-runtime + + io.quarkus + quarkus-jsonb-runtime + org.jboss.resteasy resteasy-json-binding-provider diff --git a/extensions/smallrye-health/deployment/pom.xml b/extensions/smallrye-health/deployment/pom.xml index e2849e0757e9f..503f8f0a958f6 100644 --- a/extensions/smallrye-health/deployment/pom.xml +++ b/extensions/smallrye-health/deployment/pom.xml @@ -42,6 +42,10 @@ io.quarkus quarkus-undertow + + io.quarkus + quarkus-jsonp + io.quarkus quarkus-smallrye-health-runtime diff --git a/extensions/smallrye-health/runtime/pom.xml b/extensions/smallrye-health/runtime/pom.xml index f65313afa56e2..df5b954261b04 100644 --- a/extensions/smallrye-health/runtime/pom.xml +++ b/extensions/smallrye-health/runtime/pom.xml @@ -44,8 +44,8 @@ quarkus-undertow-runtime - org.glassfish - javax.json + io.quarkus + quarkus-jsonp-runtime org.jboss.spec.javax.servlet diff --git a/extensions/smallrye-jwt/deployment/pom.xml b/extensions/smallrye-jwt/deployment/pom.xml index c20e22e4dfa1b..543fd03edf511 100644 --- a/extensions/smallrye-jwt/deployment/pom.xml +++ b/extensions/smallrye-jwt/deployment/pom.xml @@ -46,6 +46,10 @@ io.quarkus quarkus-undertow + + io.quarkus + quarkus-jsonp + io.quarkus quarkus-elytron-security diff --git a/extensions/smallrye-jwt/runtime/pom.xml b/extensions/smallrye-jwt/runtime/pom.xml index 8687d17526544..79ccccd51e994 100644 --- a/extensions/smallrye-jwt/runtime/pom.xml +++ b/extensions/smallrye-jwt/runtime/pom.xml @@ -51,8 +51,8 @@ quarkus-undertow-runtime - org.glassfish - javax.json + io.quarkus + quarkus-jsonp-runtime org.jboss.spec.javax.servlet diff --git a/extensions/smallrye-metrics/deployment/pom.xml b/extensions/smallrye-metrics/deployment/pom.xml index e37a3a7019001..71b81ed2f1dd5 100644 --- a/extensions/smallrye-metrics/deployment/pom.xml +++ b/extensions/smallrye-metrics/deployment/pom.xml @@ -42,6 +42,10 @@ io.quarkus quarkus-arc + + io.quarkus + quarkus-jsonp + io.quarkus quarkus-smallrye-metrics-runtime diff --git a/extensions/smallrye-metrics/runtime/pom.xml b/extensions/smallrye-metrics/runtime/pom.xml index d24443f815ec5..d0e4934a74e49 100644 --- a/extensions/smallrye-metrics/runtime/pom.xml +++ b/extensions/smallrye-metrics/runtime/pom.xml @@ -48,8 +48,8 @@ quarkus-arc-runtime - org.glassfish - javax.json + io.quarkus + quarkus-jsonp-runtime org.jboss.spec.javax.servlet diff --git a/extensions/smallrye-opentracing/deployment/pom.xml b/extensions/smallrye-opentracing/deployment/pom.xml index 17739bb010e2f..2eb46716179c9 100644 --- a/extensions/smallrye-opentracing/deployment/pom.xml +++ b/extensions/smallrye-opentracing/deployment/pom.xml @@ -55,12 +55,8 @@ quarkus-jaeger - io.smallrye - smallrye-opentracing - - - javax.enterprise - cdi-api + io.quarkus + quarkus-jsonp diff --git a/extensions/smallrye-opentracing/runtime/pom.xml b/extensions/smallrye-opentracing/runtime/pom.xml index cf9506c25f42d..e97483c653424 100644 --- a/extensions/smallrye-opentracing/runtime/pom.xml +++ b/extensions/smallrye-opentracing/runtime/pom.xml @@ -30,7 +30,6 @@ Quarkus - SmallRye OpenTracing - Runtime - org.eclipse.microprofile.config microprofile-config-api @@ -52,8 +51,8 @@ quarkus-undertow-runtime - org.glassfish - javax.json + io.quarkus + quarkus-jsonp-runtime org.jboss.spec.javax.servlet diff --git a/integration-tests/main/pom.xml b/integration-tests/main/pom.xml index 888e86630867d..d7cbb70a0fcfe 100644 --- a/integration-tests/main/pom.xml +++ b/integration-tests/main/pom.xml @@ -129,10 +129,6 @@ org.jboss.resteasy resteasy-jaxb-provider - - org.glassfish - javax.json - org.jboss.resteasy resteasy-rxjava2 diff --git a/test-framework/common/pom.xml b/test-framework/common/pom.xml index e09bc3908e576..b0778236b18e2 100644 --- a/test-framework/common/pom.xml +++ b/test-framework/common/pom.xml @@ -36,8 +36,8 @@ quarkus-core - org.glassfish - javax.json + io.quarkus + quarkus-jsonp org.jboss