From 1f75f78d9e6849692dcd5dbcfa4e2a35c6a5ce72 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Wed, 1 Dec 2021 22:25:49 +0200 Subject: [PATCH] Export module sun.security.action for DB2 jdbc driver com.ibm.db2:jcc:11.5.6.0 accesses sun.security.action.GetPropertyAction which is strongly encapsulated in Java 17 requiring --add-exports=java.base/sun.security.action=ALL-UNNAMED --- .../io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java b/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java index aed66cdfac0b5..6ae0cfd791015 100644 --- a/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java +++ b/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java @@ -14,6 +14,7 @@ import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.NativeImageEnableAllCharsetsBuildItem; import io.quarkus.deployment.builditem.SslNativeConfigBuildItem; +import io.quarkus.deployment.builditem.nativeimage.JPMSExportBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageConfigBuildItem; import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; import io.quarkus.jdbc.db2.runtime.DB2AgroalConnectionConfigurer; @@ -77,4 +78,12 @@ void registerServiceBinding(Capabilities capabilities, } dbKind.produce(new DefaultDataSourceDbKindBuildItem(DatabaseKind.DB2)); } + + @BuildStep + void addBouncyCastleExportsToNativeImage(BuildProducer jpmsExports) { + // com.ibm.db2:jcc:11.5.6.0 accesses sun.security.action.GetPropertyAction + // which is strongly encapsulated in Java 17 requiring + // --add-exports=java.base/sun.security.action=ALL-UNNAMED + jpmsExports.produce(new JPMSExportBuildItem("java.base", "sun.security.action")); + } }