From 69a55d007e581a36c4b26c33e222076ea402cc4f Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Thu, 28 Nov 2019 12:27:05 +1100 Subject: [PATCH] The big ClassLoader change This changes the way Quarkus ClassLoading works, to allow for isolated class loaders. It also unifies how Quarkus is launched, so every different mode we support uses the same mechanism for both curation and launch. Tests are now run in an isolated ClassLoader, which means that a proxy is created that runs the tests from within the isolated ClassLoader. This currently has a quirk where @BeforeAll methods are run twice, which will be fixed in the next JUnit release. This can be worked around by using @QuarkusBeforeAll. --- .../java/io/quarkus/tika/deployment/TikaProcessor.java | 7 +++++++ .../tika/runtime/src/main/resources/META-INF/beans.xml | 0 2 files changed, 7 insertions(+) delete mode 100644 extensions/tika/runtime/src/main/resources/META-INF/beans.xml 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 6ca09a9..154f428 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 @@ -16,6 +16,7 @@ import org.apache.tika.detect.EncodingDetector; import org.apache.tika.parser.Parser; +import io.quarkus.arc.deployment.AdditionalBeanBuildItem; import io.quarkus.arc.deployment.BeanContainerBuildItem; import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.annotations.BuildProducer; @@ -32,6 +33,7 @@ import io.quarkus.tika.TikaParseException; import io.quarkus.tika.runtime.TikaConfiguration; import io.quarkus.tika.runtime.TikaParserParameter; +import io.quarkus.tika.runtime.TikaParserProducer; import io.quarkus.tika.runtime.TikaRecorder; public class TikaProcessor { @@ -52,6 +54,11 @@ public class TikaProcessor { private TikaConfiguration config; + @BuildStep + AdditionalBeanBuildItem beans() { + return AdditionalBeanBuildItem.builder().addBeanClasses(TikaParserProducer.class).build(); + } + @BuildStep @Record(ExecutionTime.STATIC_INIT) TikaParsersConfigBuildItem initializeTikaParser(BeanContainerBuildItem beanContainer, TikaRecorder recorder) diff --git a/extensions/tika/runtime/src/main/resources/META-INF/beans.xml b/extensions/tika/runtime/src/main/resources/META-INF/beans.xml deleted file mode 100644 index e69de29..0000000