Skip to content

Commit

Permalink
Register jakarta.json.spi.JsonProvider service provider
Browse files Browse the repository at this point in the history
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 <guillaume.smet@gmail.com>
(cherry picked from commit 8164c7f)
  • Loading branch information
zakkak authored and gsmet committed Nov 27, 2024
1 parent 6d30f94 commit 1b2e431
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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<FeatureBuildItem> feature,
BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<NativeImageResourceBundleBuildItem> resourceBundle) {
reflectiveClass.produce(
ReflectiveClassBuildItem.builder(JsonProviderImpl.class.getName()).build());
void build(BuildProducer<ServiceProviderBuildItem> serviceProviders) {

serviceProviders.produce(ServiceProviderBuildItem.allProvidersFromClassPath(JsonProvider.class.getName()));
}

}

0 comments on commit 1b2e431

Please sign in to comment.