diff --git a/docs/modules/ROOT/pages/includes/attributes.adoc b/docs/modules/ROOT/pages/includes/attributes.adoc index 13e08d441..99fc4645b 100644 --- a/docs/modules/ROOT/pages/includes/attributes.adoc +++ b/docs/modules/ROOT/pages/includes/attributes.adoc @@ -1,4 +1,4 @@ -:quarkus-version: 3.2.1.Final +:quarkus-version: 3.2.2.Final :quarkus-amazon-services-version: 2.4.1 :maven-version: 3.8.1+ diff --git a/s3/runtime/pom.xml b/s3/runtime/pom.xml index af1073859..adfee75b0 100644 --- a/s3/runtime/pom.xml +++ b/s3/runtime/pom.xml @@ -74,6 +74,11 @@ org.jboss.logging commons-logging-jboss-logging + + org.graalvm.sdk + graal-sdk + provided + diff --git a/s3/runtime/src/main/java/io/quarkus/amazon/s3/runtime/S3CrtSubstitutions.java b/s3/runtime/src/main/java/io/quarkus/amazon/s3/runtime/S3CrtSubstitutions.java new file mode 100644 index 000000000..acd240c37 --- /dev/null +++ b/s3/runtime/src/main/java/io/quarkus/amazon/s3/runtime/S3CrtSubstitutions.java @@ -0,0 +1,34 @@ +package io.quarkus.amazon.s3.runtime; + +import java.util.Arrays; +import java.util.function.BooleanSupplier; + +import com.oracle.svm.core.annotate.Delete; +import com.oracle.svm.core.annotate.TargetClass; + +import software.amazon.awssdk.services.s3.internal.crt.DefaultS3CrtAsyncClient; +import software.amazon.awssdk.services.s3.internal.crt.S3CrtAsyncClient; + +public class S3CrtSubstitutions { + + static final String SOFTWARE_AMAZON_AWSSDK_CRT_PACKAGE = "software.amazon.awssdk.crt"; + + static final class IsCrtAbsent implements BooleanSupplier { + @Override + public boolean getAsBoolean() { + return !Arrays.asList(Package.getPackages()).stream() + .map(p -> p.getName()) + .anyMatch(p -> p.equals(SOFTWARE_AMAZON_AWSSDK_CRT_PACKAGE)); + } + } +} + +@TargetClass(value = DefaultS3CrtAsyncClient.class, onlyWith = S3CrtSubstitutions.IsCrtAbsent.class) +@Delete +final class Delete_DefaultS3CrtAsyncClient { +} + +@TargetClass(value = S3CrtAsyncClient.class, onlyWith = S3CrtSubstitutions.IsCrtAbsent.class) +@Delete +final class Delete_S3CrtAsyncClient { +}