From 4aaf21d965ca9b07688f7bfc751e7858c58a1a70 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 `META-INF/services/jakarta.json.spi.JsonProvider` is accessed as a resource by SmallRyeHealthReporter. Registering the service provider removes warnings related to the access when using `-H:ThrowMissingRegistrationErrors=` --- .../java/io/quarkus/jsonp/deployment/JsonpProcessor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 8bc6e023862371..ed90548af715d4 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 @@ -5,16 +5,20 @@ 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) { + BuildProducer serviceProviders) { reflectiveClass.produce( ReflectiveClassBuildItem.builder(JsonProviderImpl.class.getName()).build()); + + // Register jakarta.json.spi.JsonProvider provider which is accessed by SmallRyeHealthReporter + serviceProviders.produce(new ServiceProviderBuildItem("jakarta.json.spi.JsonProvider")); } + }