From 52586bc1932169c4c0fc0ef026e24c163d5de79f Mon Sep 17 00:00:00 2001 From: xstefank Date: Thu, 29 Aug 2024 16:42:02 +0200 Subject: [PATCH] fix: ignore vertx warning in reflective hierarchy during compilation Signed-off-by: xstefank --- .../deployment/OperatorSDKProcessor.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java b/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java index 52e4e6b57..483c6b9bc 100644 --- a/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java +++ b/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java @@ -36,6 +36,7 @@ import io.quarkus.deployment.builditem.*; import io.quarkus.deployment.builditem.nativeimage.ForceNonWeakReflectiveClassBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem; import io.quarkus.deployment.metrics.MetricsCapabilityBuildItem; import io.quarkus.gizmo.AssignableResultHandle; import io.quarkus.gizmo.MethodCreator; @@ -261,6 +262,30 @@ void initializeRuntimeNamespacesFromBuildTimeValues( } + /** + * Ignore warnings related to non-indexed classes in the reflective hierarchy. At this point, we cannot know + * if they are actually needed for native compilation. + * + * This could probably be removed once https://github.com/quarkiverse/quarkus-operator-sdk/issues/941 is resolved. + * + */ + @BuildStep + void ignoreNonIndexedClassesWarningsInReflectiveHierarchy( + BuildProducer reflectiveHierarchyIgnoreWarningBuildItemBuildProducer) { + reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce( + new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple(io.vertx.core.Vertx.class.getName()))); + reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce( + new ReflectiveHierarchyIgnoreWarningBuildItem( + DotName.createSimple(io.vertx.core.http.HttpClient.class.getName()))); + reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce( + new ReflectiveHierarchyIgnoreWarningBuildItem( + DotName.createSimple(io.vertx.core.http.WebSocket.class.getName()))); + reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce( + new ReflectiveHierarchyIgnoreWarningBuildItem( + DotName.createSimple(io.vertx.core.net.ProxyType.class.getName()))); + + } + private void registerAssociatedClassesForReflection(BuildProducer reflectionClasses, BuildProducer forcedReflectionClasses, Set classNamesToRegister) {