-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
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
These are causing warnings 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
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...ons/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyOverrideMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
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"; | ||
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)); | ||
} | ||
} |