From 6a76562691f48b2638100a77a6326d4984570acb Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Fri, 22 Nov 2024 17:39:24 +0200 Subject: [PATCH] Register methods & classes reflectively accessed by java.io.Console --- .../quarkus/deployment/ConsoleProcessor.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 core/deployment/src/main/java/io/quarkus/deployment/ConsoleProcessor.java 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])); + } +}