forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register jakarta.json.spi.JsonProvider service provider
Register jakarta.json.spi.JsonProvider as a service provider so that both the service file and the implementations are included.
- Loading branch information
Showing
1 changed file
with
6 additions
and
5 deletions.
There are no files selected for viewing
11 changes: 6 additions & 5 deletions
11
extensions/jsonp/deployment/src/main/java/io/quarkus/jsonp/deployment/JsonpProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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())); | ||
} | ||
|
||
} |