From 2f7386d8208b31e2174ec5ac03d514be790ab27f Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Fri, 25 Nov 2022 16:18:18 +0200 Subject: [PATCH] Exclude Netty's reflection configuration files These are causing warnigns during native image compilation as they try to access classes that are not on the classpath (e.g. `net.jpountz.lz4.LZ4Exception`). Closes #29413 --- .../netty/deployment/NettyOverrideMetadata.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyOverrideMetadata.java diff --git a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyOverrideMetadata.java b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyOverrideMetadata.java new file mode 100644 index 0000000000000..0154b8f13fc89 --- /dev/null +++ b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyOverrideMetadata.java @@ -0,0 +1,15 @@ +package io.quarkus.netty.deployment; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.nativeimage.ExcludeConfigBuildItem; + +public class NettyOverrideMetadata { + + static final String NETTY_JAR_MATCH_REGEX = "io\\.netty\\.netty-(codec|handler)"; + static final String NETTY_REFLECT_CONFIG_MATCH_REGEX = "/META-INF/native-image/io\\.netty/netty-(codec|handler)/generated/handlers/reflect-config\\.json"; + + @BuildStep + ExcludeConfigBuildItem excludeNettyDirectives() { + return new ExcludeConfigBuildItem(NETTY_JAR_MATCH_REGEX, NETTY_REFLECT_CONFIG_MATCH_REGEX); + } +}