Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude Netty's reflection configuration files
Browse files Browse the repository at this point in the history
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
zakkak committed Nov 25, 2022

Verified

This commit was signed with the committer’s verified signature. The key has expired.
zakkak Foivos Zakkak
1 parent a548ac8 commit 1916593
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.quarkus.netty.deployment;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.ExcludeConfigBuildItem;

public class NettyOverrideMetadata {

static final String NETTY_CODEC_JAR_MATCH_REGEX = ".*io\\.netty\\.netty-codec.*\\.jar";
static final String NETTY_CODEC_REFLECT_CONFIG_MATCH_REGEX = "META-INF/native-image/io.netty/netty-codec/generated/handlers/reflect-config\\.json";
static final String NETTY_HANDLER_JAR_MATCH_REGEX = ".*io\\.netty\\.netty-handler.*\\.jar";
static final String NETTY_HANDLER_REFLECT_CONFIG_MATCH_REGEX = "META-INF/native-image/io.netty/netty-handler/generated/handlers/reflect-config\\.json";

@BuildStep
void excludeNettyDirectives(BuildProducer<ExcludeConfigBuildItem> nativeImageExclusions) {
nativeImageExclusions
.produce(new ExcludeConfigBuildItem(NETTY_CODEC_JAR_MATCH_REGEX, NETTY_CODEC_REFLECT_CONFIG_MATCH_REGEX));
nativeImageExclusions
.produce(new ExcludeConfigBuildItem(NETTY_HANDLER_JAR_MATCH_REGEX, NETTY_HANDLER_REFLECT_CONFIG_MATCH_REGEX));
}
}

0 comments on commit 1916593

Please sign in to comment.