Skip to content

Commit 78b8c93

Browse files
authored
Merge pull request #939 from xstefank/vertx-warning-i936
fix: ignore vertx warning in reflective hierarchy during compilation
2 parents f5b55f8 + 52586bc commit 78b8c93

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import io.quarkus.deployment.builditem.*;
3737
import io.quarkus.deployment.builditem.nativeimage.ForceNonWeakReflectiveClassBuildItem;
3838
import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem;
39+
import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem;
3940
import io.quarkus.deployment.metrics.MetricsCapabilityBuildItem;
4041
import io.quarkus.gizmo.AssignableResultHandle;
4142
import io.quarkus.gizmo.MethodCreator;
@@ -261,6 +262,30 @@ void initializeRuntimeNamespacesFromBuildTimeValues(
261262

262263
}
263264

265+
/**
266+
* Ignore warnings related to non-indexed classes in the reflective hierarchy. At this point, we cannot know
267+
* if they are actually needed for native compilation.
268+
*
269+
* This could probably be removed once https://github.com/quarkiverse/quarkus-operator-sdk/issues/941 is resolved.
270+
*
271+
*/
272+
@BuildStep
273+
void ignoreNonIndexedClassesWarningsInReflectiveHierarchy(
274+
BuildProducer<ReflectiveHierarchyIgnoreWarningBuildItem> reflectiveHierarchyIgnoreWarningBuildItemBuildProducer) {
275+
reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce(
276+
new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple(io.vertx.core.Vertx.class.getName())));
277+
reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce(
278+
new ReflectiveHierarchyIgnoreWarningBuildItem(
279+
DotName.createSimple(io.vertx.core.http.HttpClient.class.getName())));
280+
reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce(
281+
new ReflectiveHierarchyIgnoreWarningBuildItem(
282+
DotName.createSimple(io.vertx.core.http.WebSocket.class.getName())));
283+
reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce(
284+
new ReflectiveHierarchyIgnoreWarningBuildItem(
285+
DotName.createSimple(io.vertx.core.net.ProxyType.class.getName())));
286+
287+
}
288+
264289
private void registerAssociatedClassesForReflection(BuildProducer<ReflectiveHierarchyBuildItem> reflectionClasses,
265290
BuildProducer<ForceNonWeakReflectiveClassBuildItem> forcedReflectionClasses,
266291
Set<String> classNamesToRegister) {

0 commit comments

Comments
 (0)