diff --git a/deployment/src/main/java/io/quarkus/tika/deployment/TikaProcessor.java b/deployment/src/main/java/io/quarkus/tika/deployment/TikaProcessor.java index 1314b67..491595a 100644 --- a/deployment/src/main/java/io/quarkus/tika/deployment/TikaProcessor.java +++ b/deployment/src/main/java/io/quarkus/tika/deployment/TikaProcessor.java @@ -1,6 +1,7 @@ package io.quarkus.tika.deployment; import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; @@ -23,11 +24,13 @@ import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.annotations.ExecutionTime; import io.quarkus.deployment.annotations.Record; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.NativeImageEnableAllCharsetsBuildItem; import io.quarkus.deployment.builditem.NativeImageFeatureBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceDirectoryBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; import io.quarkus.deployment.util.ServiceUtil; @@ -90,6 +93,16 @@ public void registerTikaCoreResources(BuildProducer reflectiveClass, + CombinedIndexBuildItem combinedIndex) { + + final List classNames = new ArrayList<>(); + classNames.add(org.apache.tika.parser.pdf.PDFParser.class.getName()); + reflectiveClass.produce( + ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).methods(true).build()); + } + @BuildStep public void registerTikaParsersResources(BuildProducer resource) { resource.produce(new NativeImageResourceBuildItem("org/apache/tika/parser/pdf/PDFParser.properties"));