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.
  • Loading branch information
zakkak authored and gsmet committed Nov 26, 2024
1 parent 9361824 commit 2844378
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
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());
BuildProducer<ServiceProviderBuildItem> serviceProviders) {

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

}

0 comments on commit 2844378

Please sign in to comment.