From 5d43d7785d08ce694c08c187973b31599b8a5015 Mon Sep 17 00:00:00 2001 From: Sergey Beryozkin Date: Mon, 18 Oct 2021 14:45:46 +0100 Subject: [PATCH] Enable all charsets in native image for quarkus-tika --- docs/src/main/asciidoc/tika.adoc | 13 ------------- .../io/quarkus/tika/deployment/TikaProcessor.java | 6 ++++++ integration-tests/tika/pom.xml | 4 ---- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/docs/src/main/asciidoc/tika.adoc b/docs/src/main/asciidoc/tika.adoc index 8e2196b165741..b76940061ec8a 100644 --- a/docs/src/main/asciidoc/tika.adoc +++ b/docs/src/main/asciidoc/tika.adoc @@ -11,19 +11,6 @@ This guide explains how your Quarkus application can use https://tika.apache.org https://tika.apache.org/[Apache Tika] is a content analysis toolkit which is used to parse the documents in PDF, Open Document, Excel and many other well known binary and text formats using a simple uniform API. Both the document text and properties (metadata) are available once the document has been parsed. -[NOTE] -==== -If you are planning to run the application as a native executable and parse documents that may have been created with charsets different than the standard ones supported in Java such as `UTF-8` then you should configure Quarkus to get the native image generator include all the charsets available to the JVM: -[source,xml] ----- - - native - true - ----- -==== - - == Prerequisites To complete this guide, you need: diff --git a/extensions/tika/deployment/src/main/java/io/quarkus/tika/deployment/TikaProcessor.java b/extensions/tika/deployment/src/main/java/io/quarkus/tika/deployment/TikaProcessor.java index 182abf341a5cc..d4ff2af0c0607 100644 --- a/extensions/tika/deployment/src/main/java/io/quarkus/tika/deployment/TikaProcessor.java +++ b/extensions/tika/deployment/src/main/java/io/quarkus/tika/deployment/TikaProcessor.java @@ -26,6 +26,7 @@ import io.quarkus.deployment.annotations.ExecutionTime; import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.NativeImageEnableAllCharsetsBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceDirectoryBuildItem; import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; @@ -87,6 +88,11 @@ public void registerPdfBoxResources(BuildProducernative - - - true -