Skip to content

Commit

Permalink
Register java.sql.Driver service for Agroal
Browse files Browse the repository at this point in the history
Relates to quarkusio#41995
  • Loading branch information
zakkak committed Jan 13, 2025
1 parent 54619a8 commit b925a5e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -91,6 +92,7 @@ void build(
List<JdbcDriverBuildItem> jdbcDriverBuildItems,
BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<NativeImageResourceBuildItem> resource,
BuildProducer<ServiceProviderBuildItem> service,
Capabilities capabilities,
BuildProducer<ExtensionSslNativeSupportBuildItem> sslNativeSupport,
BuildProducer<AggregatedDataSourceBuildTimeConfigBuildItem> aggregatedConfig,
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit b925a5e

Please sign in to comment.