Skip to content

Commit

Permalink
Register Parallel Database Query related elements for reflection
Browse files Browse the repository at this point in the history
Although Quarkus doesn't include PDQ by default the DB2 JDBC driver
still tries to access some PDQ-related elements.

Relates to quarkusio#41995
  • Loading branch information
zakkak committed Jan 13, 2025
1 parent ec6bf3c commit 81bc607
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.quarkus.deployment.builditem.nativeimage.JPMSExportBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageAllowIncompleteClasspathBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageConfigBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.jdbc.db2.runtime.DB2AgroalConnectionConfigurer;
Expand Down Expand Up @@ -88,6 +89,10 @@ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveCla
T4Resources.class)
.reason(getClass().getName() + " DB2 JDBC driver classes")
.build());

reflectiveClass.produce(ReflectiveClassBuildItem.builder("com.ibm.pdq.cmx.client.DataSourceFactory")
.reason(getClass().getName() + " accessed reflectively by DB2 JDBC driver")
.build());
}

@BuildStep
Expand Down Expand Up @@ -133,4 +138,9 @@ void addExportsToNativeImage(BuildProducer<JPMSExportBuildItem> jpmsExports) {
// --add-exports=java.base/sun.security.action=ALL-UNNAMED
jpmsExports.produce(new JPMSExportBuildItem("java.base", "sun.security.action"));
}

@BuildStep
NativeImageResourceBuildItem registerResources() {
return new NativeImageResourceBuildItem("pdq.properties");
}
}

0 comments on commit 81bc607

Please sign in to comment.