Skip to content

Commit

Permalink
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
  • Loading branch information
zakkak committed Nov 29, 2022
1 parent a548ac8 commit 2f7386d
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 2f7386d

Please sign in to comment.