diff --git a/core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java b/core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java index ca859286bedda..37eb9e1da8dac 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java @@ -103,6 +103,7 @@ public final class ExtensionLoader { private ExtensionLoader() { } + private static final Logger loadLog = Logger.getLogger("io.quarkus.deployment"); private static final Logger cfgLog = Logger.getLogger("io.quarkus.configuration"); private static final String CONFIG_ROOTS_LIST = "META-INF/quarkus-config-roots.list"; @@ -325,6 +326,7 @@ public static Consumer loadStepsFrom(Class clazz, BuildTim stepConfig = stepConfig.andThen(bsb -> bsb.consumes(buildItemClass)); ctorParamFns.add(bc -> bc.consumeMulti(buildItemClass)); } else if (isConsumerOf(parameterType, BuildItem.class)) { + deprecatedProducer(parameter); final Class buildItemClass = rawTypeOfParameter(parameterType, 0) .asSubclass(BuildItem.class); if (overridable) { @@ -343,6 +345,7 @@ public static Consumer loadStepsFrom(Class clazz, BuildTim } ctorParamFns.add(bc -> (Consumer) bc::produce); } else if (isBuildProducerOf(parameterType, BuildItem.class)) { + deprecatedProducer(parameter); final Class buildItemClass = rawTypeOfParameter(parameterType, 0) .asSubclass(BuildItem.class); if (overridable) { @@ -434,6 +437,7 @@ public static Consumer loadStepsFrom(Class clazz, BuildTim stepInstanceSetup = stepInstanceSetup .andThen((bc, o) -> ReflectUtil.setFieldVal(field, o, bc.consumeMulti(buildItemClass))); } else if (isConsumerOf(fieldType, BuildItem.class)) { + deprecatedProducer(field); final Class buildItemClass = rawTypeOfParameter(fieldType, 0).asSubclass(BuildItem.class); if (overridable) { if (weak) { @@ -452,6 +456,7 @@ public static Consumer loadStepsFrom(Class clazz, BuildTim stepInstanceSetup = stepInstanceSetup .andThen((bc, o) -> ReflectUtil.setFieldVal(field, o, (Consumer) bc::produce)); } else if (isBuildProducerOf(fieldType, BuildItem.class)) { + deprecatedProducer(field); final Class buildItemClass = rawTypeOfParameter(fieldType, 0).asSubclass(BuildItem.class); if (overridable) { if (weak) { @@ -998,6 +1003,12 @@ public String toString() { return chainConfig; } + private static void deprecatedProducer(final Object element) { + loadLog.warnf( + "Producing values from constructors and fields is no longer supported and will be removed in a future release: %s", + element); + } + protected static List getMethods(Class clazz) { List declaredMethods = new ArrayList<>(); if (!clazz.getName().equals(Object.class.getName())) { diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/RegisterForReflectionBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/RegisterForReflectionBuildStep.java index d22ce75cabae0..891e6f4d1b5de 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/RegisterForReflectionBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/RegisterForReflectionBuildStep.java @@ -19,14 +19,11 @@ public class RegisterForReflectionBuildStep { private static final Logger log = Logger.getLogger(RegisterForReflectionBuildStep.class); - @Inject - BuildProducer reflectiveClass; - @Inject CombinedIndexBuildItem combinedIndexBuildItem; @BuildStep - public void build() { + public void build(BuildProducer reflectiveClass) { for (AnnotationInstance i : combinedIndexBuildItem.getIndex() .getAnnotations(DotName.createSimple(RegisterForReflection.class.getName()))) { @@ -40,21 +37,21 @@ public void build() { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (targetsValue == null && classNamesValue == null) { ClassInfo classInfo = i.target().asClass(); - registerClass(classLoader, classInfo.name().toString(), methods, fields, ignoreNested); + registerClass(classLoader, classInfo.name().toString(), methods, fields, ignoreNested, reflectiveClass); continue; } if (targetsValue != null) { Type[] targets = targetsValue.asClassArray(); for (Type type : targets) { - registerClass(classLoader, type.name().toString(), methods, fields, ignoreNested); + registerClass(classLoader, type.name().toString(), methods, fields, ignoreNested, reflectiveClass); } } if (classNamesValue != null) { String[] classNames = classNamesValue.asStringArray(); for (String className : classNames) { - registerClass(classLoader, className, methods, fields, ignoreNested); + registerClass(classLoader, className, methods, fields, ignoreNested, reflectiveClass); } } } @@ -64,7 +61,7 @@ public void build() { * BFS Recursive Method to register a class and it's inner classes for Reflection. */ private void registerClass(ClassLoader classLoader, String className, boolean methods, boolean fields, - boolean ignoreNested) { + boolean ignoreNested, final BuildProducer reflectiveClass) { reflectiveClass.produce(new ReflectiveClassBuildItem(methods, fields, className)); if (ignoreNested) { @@ -74,7 +71,7 @@ private void registerClass(ClassLoader classLoader, String className, boolean me try { Class[] declaredClasses = classLoader.loadClass(className).getDeclaredClasses(); for (Class clazz : declaredClasses) { - registerClass(classLoader, clazz.getName(), methods, fields, false); + registerClass(classLoader, clazz.getName(), methods, fields, false, reflectiveClass); } } catch (ClassNotFoundException e) { log.warnf(e, "Failed to load Class %s", className); diff --git a/core/test-extension/deployment/src/main/java/io/quarkus/extest/deployment/TestProcessor.java b/core/test-extension/deployment/src/main/java/io/quarkus/extest/deployment/TestProcessor.java index 88c0a907dab11..450146949f3c3 100644 --- a/core/test-extension/deployment/src/main/java/io/quarkus/extest/deployment/TestProcessor.java +++ b/core/test-extension/deployment/src/main/java/io/quarkus/extest/deployment/TestProcessor.java @@ -25,7 +25,6 @@ import java.util.function.BooleanSupplier; import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; @@ -81,9 +80,6 @@ public final class TestProcessor { static DotName TEST_ANNOTATION = DotName.createSimple(TestAnnotation.class.getName()); static DotName TEST_ANNOTATION_SCOPE = DotName.createSimple(ApplicationScoped.class.getName()); - @Inject - BuildProducer resource; - TestConfigRoot configRoot; TestBuildTimeConfig buildTimeConfig; TestBuildAndRunTimeConfig buildAndRunTimeConfig; @@ -125,7 +121,7 @@ LogHandlerBuildItem registerAdditionalLogHandler(final AdditionalLogHandlerValue } @BuildStep - void registerNativeImageResources() { + void registerNativeImageResources(BuildProducer resource) { resource.produce(new NativeImageResourceBuildItem("/DSAPublicKey.encoded")); } diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java index 5b4207478783c..99c56a9b69aeb 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java @@ -47,13 +47,11 @@ public class BeanArchiveProcessor { @Inject List generatedBeans; - @Inject - BuildProducer generatedClass; - ArcConfig config; @BuildStep - public BeanArchiveIndexBuildItem build(LiveReloadBuildItem liveReloadBuildItem) throws Exception { + public BeanArchiveIndexBuildItem build(LiveReloadBuildItem liveReloadBuildItem, + BuildProducer generatedClass) throws Exception { // First build an index from application archives IndexView applicationIndex = buildApplicationIndex(); diff --git a/extensions/jackson/deployment/src/main/java/io/quarkus/jackson/deployment/JacksonProcessor.java b/extensions/jackson/deployment/src/main/java/io/quarkus/jackson/deployment/JacksonProcessor.java index 8bd3b4b1646fa..e22bcc48f8f94 100755 --- a/extensions/jackson/deployment/src/main/java/io/quarkus/jackson/deployment/JacksonProcessor.java +++ b/extensions/jackson/deployment/src/main/java/io/quarkus/jackson/deployment/JacksonProcessor.java @@ -63,18 +63,6 @@ public class JacksonProcessor { private static final List MODULES_NAMES_TO_AUTO_REGISTER = Arrays.asList(TIME_MODULE, JDK8_MODULE, PARAMETER_NAMES_MODULE); - @Inject - BuildProducer reflectiveClass; - - @Inject - BuildProducer reflectiveHierarchyClass; - - @Inject - BuildProducer reflectiveMethod; - - @Inject - BuildProducer additionalBeans; - @Inject CombinedIndexBuildItem combinedIndexBuildItem; @@ -82,11 +70,15 @@ public class JacksonProcessor { List ignoreJsonDeserializeClassBuildItems; @BuildStep - CapabilityBuildItem register() { - addReflectiveClass(true, false, - "com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector", - "com.fasterxml.jackson.databind.ser.std.SqlDateSerializer", - "com.fasterxml.jackson.databind.ser.std.SqlTimeSerializer"); + CapabilityBuildItem register( + BuildProducer reflectiveClass, + BuildProducer reflectiveHierarchyClass, + BuildProducer reflectiveMethod, + BuildProducer additionalBeans) { + reflectiveClass.produce( + new ReflectiveClassBuildItem(true, false, "com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector", + "com.fasterxml.jackson.databind.ser.std.SqlDateSerializer", + "com.fasterxml.jackson.databind.ser.std.SqlTimeSerializer")); IndexView index = combinedIndexBuildItem.getIndex(); @@ -103,14 +95,14 @@ CapabilityBuildItem register() { if (CLASS.equals(annotationTarget.kind())) { DotName dotName = annotationTarget.asClass().name(); if (!ignoredDotNames.contains(dotName)) { - addReflectiveHierarchyClass(dotName); + addReflectiveHierarchyClass(dotName, reflectiveHierarchyClass); } AnnotationValue annotationValue = deserializeInstance.value("builder"); if (null != annotationValue && AnnotationValue.Kind.CLASS.equals(annotationValue.kind())) { DotName builderClassName = annotationValue.asClass().name(); if (!BUILDER_VOID.equals(builderClassName)) { - addReflectiveHierarchyClass(builderClassName); + addReflectiveHierarchyClass(builderClassName, reflectiveHierarchyClass); } } } @@ -151,7 +143,8 @@ CapabilityBuildItem register() { return new CapabilityBuildItem(Capability.JACKSON); } - private void addReflectiveHierarchyClass(DotName className) { + private void addReflectiveHierarchyClass(DotName className, + BuildProducer reflectiveHierarchyClass) { Type jandexType = Type.create(className, Type.Kind.CLASS); reflectiveHierarchyClass.produce(new ReflectiveHierarchyBuildItem.Builder() .type(jandexType) @@ -159,10 +152,6 @@ private void addReflectiveHierarchyClass(DotName className) { .build()); } - private void addReflectiveClass(boolean methods, boolean fields, String... className) { - reflectiveClass.produce(new ReflectiveClassBuildItem(methods, fields, className)); - } - @BuildStep void autoRegisterModules(BuildProducer classPathJacksonModules) { for (String module : MODULES_NAMES_TO_AUTO_REGISTER) { diff --git a/extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java b/extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java index 365071dc9024a..64f67a0c6048f 100644 --- a/extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java +++ b/extensions/jaeger/deployment/src/main/java/io/quarkus/jaeger/deployment/JaegerProcessor.java @@ -2,8 +2,6 @@ import java.util.Optional; -import javax.inject.Inject; - import io.jaegertracing.internal.JaegerTracer; import io.quarkus.deployment.Capability; import io.quarkus.deployment.Feature; @@ -25,9 +23,6 @@ public class JaegerProcessor { - @Inject - BuildProducer extensionSslNativeSupport; - @BuildStep(onlyIf = NativeBuild.class) @Record(ExecutionTime.STATIC_INIT) void setVersion(JaegerDeploymentRecorder jdr) { @@ -36,12 +31,10 @@ void setVersion(JaegerDeploymentRecorder jdr) { @BuildStep @Record(ExecutionTime.RUNTIME_INIT) - void setupTracer(JaegerDeploymentRecorder jdr, JaegerBuildTimeConfig buildTimeConfig, JaegerConfig jaeger, + ExtensionSslNativeSupportBuildItem setupTracer(JaegerDeploymentRecorder jdr, JaegerBuildTimeConfig buildTimeConfig, + JaegerConfig jaeger, ApplicationConfig appConfig, Optional metricsCapability) { - // Indicates that this extension would like the SSL support to be enabled - extensionSslNativeSupport.produce(new ExtensionSslNativeSupportBuildItem(Feature.JAEGER.getName())); - if (buildTimeConfig.enabled) { if (buildTimeConfig.metricsEnabled && metricsCapability.isPresent()) { if (metricsCapability.get().metricsSupported(MetricsFactory.MICROMETER)) { @@ -53,11 +46,14 @@ void setupTracer(JaegerDeploymentRecorder jdr, JaegerBuildTimeConfig buildTimeCo jdr.registerTracerWithoutMetrics(jaeger, appConfig); } } + + // Indicates that this extension would like the SSL support to be enabled + return new ExtensionSslNativeSupportBuildItem(Feature.JAEGER.getName()); } @BuildStep - public void build(BuildProducer feature) { - feature.produce(new FeatureBuildItem(Feature.JAEGER)); + public FeatureBuildItem build() { + return new FeatureBuildItem(Feature.JAEGER); } @BuildStep @@ -69,11 +65,11 @@ public void capability(JaegerBuildTimeConfig buildTimeConfig, } @BuildStep - public void reflectiveClasses(BuildProducer reflectiveClasses) { - reflectiveClasses.produce(ReflectiveClassBuildItem + public ReflectiveClassBuildItem reflectiveClasses() { + return ReflectiveClassBuildItem .builder("io.jaegertracing.internal.samplers.http.SamplingStrategyResponse", "io.jaegertracing.internal.samplers.http.ProbabilisticSamplingStrategy") .finalFieldsWritable(true) - .build()); + .build(); } } diff --git a/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java b/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java index cb81f21cacdb0..25907901934b4 100644 --- a/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java +++ b/extensions/jaxb/deployment/src/main/java/io/quarkus/jaxb/deployment/JaxbProcessor.java @@ -6,6 +6,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.stream.Stream; @@ -98,8 +99,7 @@ class JaxbProcessor { XmlJavaTypeAdapter.class, XmlJavaTypeAdapters.class); - private static final List> JAXB_REFLECTIVE_CLASSES = Arrays.asList( - XmlAccessOrder.class); + private static final List> JAXB_REFLECTIVE_CLASSES = Collections.singletonList(XmlAccessOrder.class); private static final DotName XML_ROOT_ELEMENT = DotName.createSimple(XmlRootElement.class.getName()); private static final DotName XML_TYPE = DotName.createSimple(XmlType.class.getName()); @@ -110,14 +110,6 @@ class JaxbProcessor { private static final List JAXB_ROOT_ANNOTATIONS = Arrays.asList(XML_ROOT_ELEMENT, XML_TYPE, XML_REGISTRY); - @Inject - BuildProducer reflectiveClass; - @Inject - BuildProducer resource; - @Inject - BuildProducer resourceBundle; - @Inject - BuildProducer runtimeClasses; @Inject ApplicationArchivesBuildItem applicationArchivesBuildItem; @@ -127,7 +119,11 @@ void processAnnotationsAndIndexFiles( BuildProducer providerItem, BuildProducer proxyDefinitions, CombinedIndexBuildItem combinedIndexBuildItem, - List fileRoots) { + List fileRoots, + BuildProducer reflectiveClass, + BuildProducer resource, + BuildProducer resourceBundle, + BuildProducer runtimeClasses) { IndexView index = combinedIndexBuildItem.getIndex(); @@ -138,7 +134,7 @@ void processAnnotationsAndIndexFiles( for (AnnotationInstance jaxbRootAnnotationInstance : index .getAnnotations(jaxbRootAnnotation)) { if (jaxbRootAnnotationInstance.target().kind() == Kind.CLASS) { - addReflectiveClass(true, true, + addReflectiveClass(reflectiveClass, true, true, jaxbRootAnnotationInstance.target().asClass().name().toString()); jaxbRootAnnotationsDetected = true; } @@ -164,20 +160,20 @@ void processAnnotationsAndIndexFiles( } if (!index.getAnnotations(XML_ANY_ELEMENT).isEmpty()) { - addReflectiveClass(false, false, "javax.xml.bind.annotation.W3CDomHandler"); + addReflectiveClass(reflectiveClass, false, false, "javax.xml.bind.annotation.W3CDomHandler"); } JAXB_ANNOTATIONS.stream() .map(Class::getName) .forEach(className -> { proxyDefinitions.produce(new NativeImageProxyDefinitionBuildItem(className, Locatable.class.getName())); - addReflectiveClass(true, false, className); + addReflectiveClass(reflectiveClass, true, false, className); }); for (JaxbFileRootBuildItem i : fileRoots) { try (Stream stream = iterateResources(i.getFileRoot())) { stream.filter(p -> p.getFileName().toString().equals("jaxb.index")) - .forEach(this::handleJaxbFile); + .forEach(p1 -> handleJaxbFile(p1, resource, reflectiveClass)); } } } @@ -185,36 +181,38 @@ void processAnnotationsAndIndexFiles( @BuildStep void registerClasses( BuildProducer nativeImageProps, - BuildProducer providerItem) { + BuildProducer providerItem, final BuildProducer reflectiveClass, + final BuildProducer resourceBundle) { - addReflectiveClass(true, false, "com.sun.xml.bind.v2.ContextFactory"); - addReflectiveClass(true, false, "com.sun.xml.internal.bind.v2.ContextFactory"); + addReflectiveClass(reflectiveClass, true, false, "com.sun.xml.bind.v2.ContextFactory"); + addReflectiveClass(reflectiveClass, true, false, "com.sun.xml.internal.bind.v2.ContextFactory"); - addReflectiveClass(true, false, "com.sun.xml.internal.stream.XMLInputFactoryImpl"); - addReflectiveClass(true, false, "com.sun.xml.internal.stream.XMLOutputFactoryImpl"); - addReflectiveClass(true, false, "com.sun.org.apache.xpath.internal.functions.FuncNot"); - addReflectiveClass(true, false, "com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl"); + addReflectiveClass(reflectiveClass, true, false, "com.sun.xml.internal.stream.XMLInputFactoryImpl"); + addReflectiveClass(reflectiveClass, true, false, "com.sun.xml.internal.stream.XMLOutputFactoryImpl"); + addReflectiveClass(reflectiveClass, true, false, "com.sun.org.apache.xpath.internal.functions.FuncNot"); + addReflectiveClass(reflectiveClass, true, false, "com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl"); - addResourceBundle("javax.xml.bind.Messages"); - addResourceBundle("javax.xml.bind.helpers.Messages"); + addResourceBundle(resourceBundle, "javax.xml.bind.Messages"); + addResourceBundle(resourceBundle, "javax.xml.bind.helpers.Messages"); nativeImageProps .produce(new NativeImageSystemPropertyBuildItem("com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize", "true")); JAXB_REFLECTIVE_CLASSES.stream() .map(Class::getName) - .forEach(className -> addReflectiveClass(true, false, className)); + .forEach(className -> addReflectiveClass(reflectiveClass, true, false, className)); providerItem .produce(new ServiceProviderBuildItem(JAXBContext.class.getName(), "com.sun.xml.bind.v2.ContextFactory")); } - private void handleJaxbFile(Path p) { + private void handleJaxbFile(Path p, BuildProducer resource, + BuildProducer reflectiveClass) { try { String path = p.toAbsolutePath().toString().substring(1); String pkg = p.toAbsolutePath().getParent().toString().substring(1).replace("/", ".") + "."; - addResource(path); + resource.produce(new NativeImageResourceBuildItem(path)); for (String line : Files.readAllLines(p)) { line = line.trim(); @@ -223,7 +221,7 @@ private void handleJaxbFile(Path p) { Class cl = Class.forName(clazz, false, Thread.currentThread().getContextClassLoader()); while (cl != Object.class) { - addReflectiveClass(true, true, cl.getName()); + addReflectiveClass(reflectiveClass, true, true, cl.getName()); cl = cl.getSuperclass(); } } @@ -249,15 +247,12 @@ public static Stream safeWalk(Path p) { } } - private void addResource(String r) { - resource.produce(new NativeImageResourceBuildItem(r)); - } - - private void addReflectiveClass(boolean methods, boolean fields, String... className) { + private void addReflectiveClass(BuildProducer reflectiveClass, boolean methods, boolean fields, + String... className) { reflectiveClass.produce(new ReflectiveClassBuildItem(methods, fields, className)); } - private void addResourceBundle(String bundle) { + private void addResourceBundle(BuildProducer resourceBundle, String bundle) { resourceBundle.produce(new NativeImageResourceBundleBuildItem(bundle)); } } diff --git a/extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/KubernetesClientProcessor.java b/extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/KubernetesClientProcessor.java index f3ecbaefc401b..963479c95bfd1 100644 --- a/extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/KubernetesClientProcessor.java +++ b/extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/KubernetesClientProcessor.java @@ -6,8 +6,6 @@ import java.util.Set; import java.util.stream.Collectors; -import javax.inject.Inject; - import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; import org.jboss.jandex.Type; @@ -40,25 +38,15 @@ public class KubernetesClientProcessor { private static final Logger log = Logger.getLogger(KubernetesClientProcessor.class.getName()); - @Inject - BuildProducer featureProducer; - - @Inject - BuildProducer reflectiveClasses; - - @Inject - BuildProducer reflectiveHierarchies; - - @Inject - BuildProducer ignoredJsonDeserializationClasses; - - @Inject - BuildProducer roleBindingProducer; - @BuildStep public void process(ApplicationIndexBuildItem applicationIndex, CombinedIndexBuildItem combinedIndexBuildItem, BuildProducer sslNativeSupport, - BuildProducer additionalBeanBuildItemBuildItem) { + BuildProducer additionalBeanBuildItemBuildItem, + BuildProducer featureProducer, + BuildProducer reflectiveClasses, + BuildProducer reflectiveHierarchies, + BuildProducer ignoredJsonDeserializationClasses, + BuildProducer roleBindingProducer) { featureProducer.produce(new FeatureBuildItem(Feature.KUBERNETES_CLIENT)); roleBindingProducer.produce(new KubernetesRoleBindingBuildItem("view", true)); diff --git a/extensions/narayana-stm/deployment/src/main/java/io/quarkus/narayana/stm/deployment/NarayanaSTMProcessor.java b/extensions/narayana-stm/deployment/src/main/java/io/quarkus/narayana/stm/deployment/NarayanaSTMProcessor.java index 7f7d5621397be..b23e3d0b602fa 100644 --- a/extensions/narayana-stm/deployment/src/main/java/io/quarkus/narayana/stm/deployment/NarayanaSTMProcessor.java +++ b/extensions/narayana-stm/deployment/src/main/java/io/quarkus/narayana/stm/deployment/NarayanaSTMProcessor.java @@ -38,12 +38,6 @@ class NarayanaSTMProcessor { @Inject CombinedIndexBuildItem combinedIndexBuildItem; - @Inject - BuildProducer reflectiveHierarchyClass; - - @Inject - BuildProducer reflectiveClass; - // register classes in need of reflection @BuildStep ReflectiveClassBuildItem registerFeature(BuildProducer feature) { @@ -72,7 +66,9 @@ public void configureRuntimeProperties(NarayanaSTMRecorder recorder) { // register STM dynamic proxies @BuildStep - NativeImageProxyDefinitionBuildItem stmProxies() { + NativeImageProxyDefinitionBuildItem stmProxies( + BuildProducer reflectiveHierarchyClass, + BuildProducer reflectiveClass) { final DotName TRANSACTIONAL = DotName.createSimple(Transactional.class.getName()); IndexView index = combinedIndexBuildItem.getIndex(); Collection proxies = new ArrayList<>(); diff --git a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java index 91aa1cc67eff3..9adeccc7290b9 100644 --- a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java +++ b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java @@ -6,7 +6,6 @@ import java.util.Random; import java.util.function.Supplier; -import javax.inject.Inject; import javax.inject.Singleton; import org.jboss.logging.Logger; @@ -42,9 +41,6 @@ class NettyProcessor { InternalLoggerFactory.setDefaultFactory(new JBossNettyLoggerFactory()); } - @Inject - BuildProducer reflectiveClass; - @BuildStep public NativeImageSystemPropertyBuildItem limitMem() { //in native mode we limit the size of the epoll array @@ -74,7 +70,7 @@ public SystemPropertyBuildItem setNettyMachineId() { } @BuildStep - NativeImageConfigBuildItem build() { + NativeImageConfigBuildItem build(BuildProducer reflectiveClass) { reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, "io.netty.channel.socket.nio.NioSocketChannel")); reflectiveClass diff --git a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java index 8b2e5b4735897..8d9549165e60a 100644 --- a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java +++ b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java @@ -15,8 +15,6 @@ import java.util.List; import java.util.Map; -import javax.inject.Inject; - import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.AnnotationTarget; import org.jboss.jandex.AnnotationValue; @@ -39,13 +37,11 @@ public class EventBusCodecProcessor { private static final Logger LOGGER = Logger.getLogger(EventBusCodecProcessor.class.getName()); - @Inject - BuildProducer reflectiveClass; - @BuildStep public void registerCodecs( BeanArchiveIndexBuildItem beanArchiveIndexBuildItem, - BuildProducer messageCodecs) { + BuildProducer messageCodecs, + BuildProducer reflectiveClass) { final IndexView index = beanArchiveIndexBuildItem.getIndex(); Collection consumeEventAnnotationInstances = index.getAnnotations(CONSUME_EVENT); diff --git a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java index 7b4e4f0f4cd1f..093f8a2c3a57e 100644 --- a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java +++ b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java @@ -6,8 +6,6 @@ import java.util.List; import java.util.Map; -import javax.inject.Inject; - import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; @@ -52,9 +50,6 @@ class VertxProcessor { private static final Logger LOGGER = Logger.getLogger(VertxProcessor.class.getName()); - @Inject - BuildProducer reflectiveClass; - @BuildStep void featureAndCapability(BuildProducer feature, BuildProducer capability) { feature.produce(new FeatureBuildItem(Feature.VERTX)); @@ -72,7 +67,7 @@ VertxBuildItem build(CoreVertxBuildItem vertx, VertxRecorder recorder, List messageConsumerBusinessMethods, BuildProducer generatedClass, AnnotationProxyBuildItem annotationProxy, LaunchModeBuildItem launchMode, ShutdownContextBuildItem shutdown, - BuildProducer serviceStart, + BuildProducer serviceStart, BuildProducer reflectiveClass, List codecs, RecorderContext recorderContext) { Map messageConsumerConfigurations = new HashMap<>(); ClassOutput classOutput = new GeneratedClassGizmoAdaptor(generatedClass, true);