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 <[email protected]>
  • Loading branch information
zakkak and gsmet committed Nov 26, 2024
1 parent 9361824 commit 8164c7f
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 8164c7f

Please sign in to comment.