diff --git a/extensions/kafka-client/deployment/pom.xml b/extensions/kafka-client/deployment/pom.xml index b8230b918680f..91301064431a1 100644 --- a/extensions/kafka-client/deployment/pom.xml +++ b/extensions/kafka-client/deployment/pom.xml @@ -27,6 +27,10 @@ quarkus-junit5-internal test + + io.quarkus + quarkus-jackson-deployment + io.quarkus quarkus-arc-deployment diff --git a/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/KafkaProcessor.java b/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/KafkaProcessor.java index e2f3a62e73578..097c7e8aa037f 100644 --- a/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/KafkaProcessor.java +++ b/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/KafkaProcessor.java @@ -145,22 +145,25 @@ public void build( reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, i.getName())); collectSubclasses(toRegister, indexBuildItem, i); } + + // Kafka requires Jackson as it uses Jackson to handle authentication and some JSON utilities. + // See https://github.com/quarkusio/quarkus/issues/16769 + // So, enable the Jackson support unconditionally. + reflectiveClass.produce( + new ReflectiveClassBuildItem(false, false, ObjectMapperSerializer.class, + ObjectMapperDeserializer.class)); + collectSubclasses(toRegister, indexBuildItem, ObjectMapperSerializer.class); + collectSubclasses(toRegister, indexBuildItem, ObjectMapperDeserializer.class); + + // Make the `io.quarkus.jackson.runtime.ObjectMapperProducer` bean cannot be removed. + beans.produce(UnremovableBeanBuildItem.beanTypes(OBJECT_MAPPER)); + if (capabilities.isPresent(Capability.JSONB)) { reflectiveClass.produce( new ReflectiveClassBuildItem(false, false, JsonbSerializer.class, JsonbDeserializer.class)); collectSubclasses(toRegister, indexBuildItem, JsonbSerializer.class); collectSubclasses(toRegister, indexBuildItem, JsonbDeserializer.class); } - if (capabilities.isPresent(Capability.JACKSON)) { - reflectiveClass.produce( - new ReflectiveClassBuildItem(false, false, ObjectMapperSerializer.class, - ObjectMapperDeserializer.class)); - collectSubclasses(toRegister, indexBuildItem, ObjectMapperSerializer.class); - collectSubclasses(toRegister, indexBuildItem, ObjectMapperDeserializer.class); - - // Make the `io.quarkus.jackson.runtime.ObjectMapperProducer` bean cannot be removed. - beans.produce(UnremovableBeanBuildItem.beanTypes(OBJECT_MAPPER)); - } for (DotName s : toRegister) { reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, s.toString())); diff --git a/extensions/kafka-client/runtime/pom.xml b/extensions/kafka-client/runtime/pom.xml index 0aadb02763414..a32618d55b7a1 100644 --- a/extensions/kafka-client/runtime/pom.xml +++ b/extensions/kafka-client/runtime/pom.xml @@ -26,7 +26,6 @@ io.quarkus quarkus-jackson - true io.quarkus diff --git a/integration-tests/kafka-avro/pom.xml b/integration-tests/kafka-avro/pom.xml index ec5178a4294cf..cdaf10ab13869 100644 --- a/integration-tests/kafka-avro/pom.xml +++ b/integration-tests/kafka-avro/pom.xml @@ -32,10 +32,6 @@ io.quarkus quarkus-resteasy - - io.quarkus - quarkus-resteasy-jackson - io.quarkus quarkus-resteasy-jsonb @@ -205,19 +201,6 @@ - - io.quarkus - quarkus-resteasy-jackson-deployment - ${project.version} - pom - test - - - * - * - - - io.quarkus quarkus-resteasy-jsonb-deployment diff --git a/integration-tests/kafka-sasl/pom.xml b/integration-tests/kafka-sasl/pom.xml index 29fa0a7af6af6..6d198595559ce 100644 --- a/integration-tests/kafka-sasl/pom.xml +++ b/integration-tests/kafka-sasl/pom.xml @@ -28,10 +28,6 @@ io.quarkus quarkus-resteasy - - io.quarkus - quarkus-resteasy-jackson - io.quarkus quarkus-resteasy-jsonb @@ -129,19 +125,6 @@ - - io.quarkus - quarkus-resteasy-jackson-deployment - ${project.version} - pom - test - - - * - * - - - io.quarkus quarkus-resteasy-jsonb-deployment diff --git a/integration-tests/kafka-snappy/pom.xml b/integration-tests/kafka-snappy/pom.xml index 418cf0a01c994..e0b8d26f3d0d1 100644 --- a/integration-tests/kafka-snappy/pom.xml +++ b/integration-tests/kafka-snappy/pom.xml @@ -28,10 +28,6 @@ io.quarkus quarkus-resteasy - - io.quarkus - quarkus-resteasy-jackson - io.quarkus quarkus-resteasy-jsonb @@ -143,19 +139,6 @@ - - io.quarkus - quarkus-resteasy-jackson-deployment - ${project.version} - pom - test - - - * - * - - - io.quarkus quarkus-resteasy-jsonb-deployment diff --git a/integration-tests/kafka-ssl/pom.xml b/integration-tests/kafka-ssl/pom.xml index 31f6125a25330..6889dbbacd19d 100644 --- a/integration-tests/kafka-ssl/pom.xml +++ b/integration-tests/kafka-ssl/pom.xml @@ -28,10 +28,6 @@ io.quarkus quarkus-resteasy - - io.quarkus - quarkus-resteasy-jackson - io.quarkus quarkus-resteasy-jsonb @@ -129,19 +125,6 @@ - - io.quarkus - quarkus-resteasy-jackson-deployment - ${project.version} - pom - test - - - * - * - - - io.quarkus quarkus-resteasy-jsonb-deployment diff --git a/integration-tests/kafka/pom.xml b/integration-tests/kafka/pom.xml index e2a92e1e0a2c3..4d1c8c3f2dac2 100644 --- a/integration-tests/kafka/pom.xml +++ b/integration-tests/kafka/pom.xml @@ -28,10 +28,6 @@ io.quarkus quarkus-resteasy - - io.quarkus - quarkus-resteasy-jackson - io.quarkus quarkus-resteasy-jsonb @@ -129,19 +125,6 @@ - - io.quarkus - quarkus-resteasy-jackson-deployment - ${project.version} - pom - test - - - * - * - - - io.quarkus quarkus-resteasy-jsonb-deployment