From d16dee7c26f1fab27db040abd5c5bb6c7b167c62 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 15 May 2023 09:49:01 +0300 Subject: [PATCH] Make check for RESTEasy Classic stricter Fixes: #33360 --- .../common/deployment/ResteasyReactiveCommonProcessor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/src/main/java/io/quarkus/resteasy/reactive/common/deployment/ResteasyReactiveCommonProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/src/main/java/io/quarkus/resteasy/reactive/common/deployment/ResteasyReactiveCommonProcessor.java index 59368bf1cfa35..8d86d692b62f3 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/src/main/java/io/quarkus/resteasy/reactive/common/deployment/ResteasyReactiveCommonProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/src/main/java/io/quarkus/resteasy/reactive/common/deployment/ResteasyReactiveCommonProcessor.java @@ -46,6 +46,7 @@ import io.quarkus.arc.deployment.BeanContainerBuildItem; import io.quarkus.arc.deployment.BuildTimeConditionBuildItem; import io.quarkus.arc.deployment.GeneratedBeanBuildItem; +import io.quarkus.bootstrap.classloading.QuarkusClassLoader; import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.Capability; import io.quarkus.deployment.annotations.BuildProducer; @@ -79,7 +80,9 @@ public class ResteasyReactiveCommonProcessor { @BuildStep void searchForProviders(Capabilities capabilities, BuildProducer producer) { - if (capabilities.isPresent(Capability.RESTEASY) || capabilities.isPresent(Capability.REST_CLIENT)) { + if (capabilities.isPresent(Capability.RESTEASY) || capabilities.isPresent(Capability.REST_CLIENT) + || QuarkusClassLoader.isClassPresentAtRuntime( + "org.jboss.resteasy.reactive.server.injection.JaxrsServerFormUrlEncodedProvider")) { // RESTEasy Classic could be imported via non-Quarkus dependencies // in this weird case we don't want the providers to be registered automatically as this would lead to multiple bean definitions return; }