All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.jjwtjackson.deployment.JjwtJacksonProcessor Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package io.quarkiverse.jjwtjackson.deployment;

import io.jsonwebtoken.impl.DefaultJwtBuilder;
import io.jsonwebtoken.io.Deserializer;
import io.jsonwebtoken.io.Serializer;
import io.jsonwebtoken.jackson.io.JacksonDeserializer;
import io.jsonwebtoken.jackson.io.JacksonSerializer;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;

class JjwtJacksonProcessor {

    @BuildStep
    void registerForReflection(BuildProducer reflectiveClasses) {
        reflectiveClasses.produce(new ReflectiveClassBuildItem(true, true, DefaultJwtBuilder.class));
    }

    @BuildStep
    void jwtServiceProviderBuildItem(BuildProducer serviceProviders) {
        serviceProviders.produce(new ServiceProviderBuildItem(Serializer.class.getName(), JacksonSerializer.class.getName()));
        serviceProviders
                .produce(new ServiceProviderBuildItem(Deserializer.class.getName(), JacksonDeserializer.class.getName()));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy