diff --git a/core/deployment/src/main/java/io/quarkus/deployment/ConsoleProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/ConsoleProcessor.java new file mode 100644 index 00000000000000..a023d1f4dd9b82 --- /dev/null +++ b/core/deployment/src/main/java/io/quarkus/deployment/ConsoleProcessor.java @@ -0,0 +1,24 @@ +package io.quarkus.deployment; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem; + +public class ConsoleProcessor { + @BuildStep + void registerResources(BuildProducer methods, BuildProducer classes) { + classes.produce(ReflectiveClassBuildItem.builder("jdk.jshell.execution.impl.ConsoleImpl$ConsoleProviderImpl") + .build()); + methods.produce( + new ReflectiveMethodBuildItem("Reflectively accessed transitively through java.io.Console's class initializer", + "jdk.jshell.execution.impl.ConsoleImpl$ConsoleProviderImpl", + "provider", new String[0])); + classes.produce(ReflectiveClassBuildItem.builder("jdk.internal.org.jline.JdkConsoleProviderImpl") + .build()); + methods.produce( + new ReflectiveMethodBuildItem("Reflectively accessed transitively through java.io.Console's class initializer", + "jdk.internal.org.jline.JdkConsoleProviderImpl", + "provider", new String[0])); + } +}