From 1b2e4318a955bb2c82ccc3959610f1051582dc0b Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Thu, 21 Nov 2024 18:46:45 +0200 Subject: [PATCH] Register jakarta.json.spi.JsonProvider service provider Register jakarta.json.spi.JsonProvider as a service provider so that both the service file and the implementations are included. Co-authored-by: Guillaume Smet (cherry picked from commit 8164c7f35ff3678486189155b9bd5139800d070c) --- .../quarkus/jsonp/deployment/JsonpProcessor.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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 index 8bc6e02386237..1f803f68dc4dd 100644 --- 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 @@ -1,20 +1,17 @@ package io.quarkus.jsonp.deployment; -import org.eclipse.parsson.JsonProviderImpl; +import jakarta.json.spi.JsonProvider; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem; -import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; public class JsonpProcessor { @BuildStep - void build(BuildProducer feature, - BuildProducer reflectiveClass, - BuildProducer resourceBundle) { - reflectiveClass.produce( - ReflectiveClassBuildItem.builder(JsonProviderImpl.class.getName()).build()); + void build(BuildProducer serviceProviders) { + + serviceProviders.produce(ServiceProviderBuildItem.allProvidersFromClassPath(JsonProvider.class.getName())); } + }