Skip to content

Commit

Permalink
Merge pull request #44649 from zakkak/2024-11-21-jakarta-json-provide…
Browse files Browse the repository at this point in the history
…r-registration

Register `jakarta.json.spi.JsonProvider` service provider
  • Loading branch information
zakkak authored Nov 27, 2024
2 parents de2a32b + 8164c7f commit 724b997
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 724b997

Please sign in to comment.