diff --git a/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/AgroalProcessor.java b/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/AgroalProcessor.java index bea70573a34d5c..762150061e6aa1 100644 --- a/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/AgroalProcessor.java +++ b/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/AgroalProcessor.java @@ -63,6 +63,7 @@ import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; import io.quarkus.maven.dependency.ArtifactKey; import io.quarkus.narayana.jta.deployment.NarayanaInitBuildItem; @@ -91,6 +92,7 @@ void build( List jdbcDriverBuildItems, BuildProducer reflectiveClass, BuildProducer resource, + BuildProducer service, Capabilities capabilities, BuildProducer sslNativeSupport, BuildProducer aggregatedConfig, @@ -141,6 +143,9 @@ void build( resource.produce(new NativeImageResourceBuildItem( "META-INF/services/" + io.agroal.api.security.AgroalSecurityProvider.class.getName())); + // accessed through io.quarkus.agroal.runtime.DataSources.loadDriversInTCCL + service.produce(new ServiceProviderBuildItem("java.sql.Driver")); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(io.agroal.pool.ConnectionHandler[].class.getName(), io.agroal.pool.ConnectionHandler.class.getName(), io.agroal.api.security.AgroalDefaultSecurityProvider.class.getName(),