diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index c5949898..dd2e3c7c 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -20,6 +20,7 @@ jobs: strategy: matrix: java: ['11'] + graalvm: ['latest', 'dev'] steps: # https://github.com/actions/virtual-environments/issues/709 - name: Free disk space @@ -38,7 +39,7 @@ jobs: - name: Setup GraalVM CE uses: graalvm/setup-graalvm@v1 with: - version: '22.1.0' + version: ${{ matrix.graalvm }} java-version: ${{ matrix.java }} components: 'native-image' - name: Build with Gradle diff --git a/functional-tests/src/test/groovy/io/micronaut/gradle/aot/MicronautAOTDockerSpec.groovy b/functional-tests/src/test/groovy/io/micronaut/gradle/aot/MicronautAOTDockerSpec.groovy index 02492160..7ca6c37f 100644 --- a/functional-tests/src/test/groovy/io/micronaut/gradle/aot/MicronautAOTDockerSpec.groovy +++ b/functional-tests/src/test/groovy/io/micronaut/gradle/aot/MicronautAOTDockerSpec.groovy @@ -82,7 +82,7 @@ COPY layers/resources /home/app/resources COPY layers/application.jar /home/app/application.jar RUN mkdir /home/app/config-dirs COPY config-dirs/generateResourcesConfigFile /home/app/config-dirs/generateResourcesConfigFile -RUN native-image -cp /home/app/libs/*.jar:/home/app/resources:/home/app/application.jar --no-fallback -H:Name=application -H:ConfigurationFileDirectories=/home/app/config-dirs/generateResourcesConfigFile -H:Class=demo.app.Application +RUN native-image -cp /home/app/libs/*.jar:/home/app/resources:/home/app/application.jar --no-fallback -H:Name=application -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED -H:ConfigurationFileDirectories=/home/app/config-dirs/generateResourcesConfigFile -H:Class=demo.app.Application FROM frolvlad/alpine-glibc:alpine-3.12 RUN apk update && apk add libstdc++ COPY --from=graalvm /home/app/application /app/application diff --git a/functional-tests/src/test/groovy/io/micronaut/gradle/docker/DockerNativeFunctionalTest.groovy b/functional-tests/src/test/groovy/io/micronaut/gradle/docker/DockerNativeFunctionalTest.groovy index 309cf050..2077b5b2 100644 --- a/functional-tests/src/test/groovy/io/micronaut/gradle/docker/DockerNativeFunctionalTest.groovy +++ b/functional-tests/src/test/groovy/io/micronaut/gradle/docker/DockerNativeFunctionalTest.groovy @@ -573,7 +573,7 @@ COPY layers/resources /home/alternate/resources COPY layers/application.jar /home/alternate/application.jar RUN mkdir /home/alternate/config-dirs COPY config-dirs/generateResourcesConfigFile /home/alternate/config-dirs/generateResourcesConfigFile -RUN native-image -cp /home/alternate/libs/*.jar:/home/alternate/resources:/home/alternate/application.jar --no-fallback -H:Name=application -H:ConfigurationFileDirectories=/home/alternate/config-dirs/generateResourcesConfigFile -H:Class=example.Application +RUN native-image -cp /home/alternate/libs/*.jar:/home/alternate/resources:/home/alternate/application.jar --no-fallback -H:Name=application -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED -H:ConfigurationFileDirectories=/home/alternate/config-dirs/generateResourcesConfigFile -H:Class=example.Application FROM frolvlad/alpine-glibc:alpine-3.12 RUN apk update && apk add libstdc++ HEALTHCHECK CMD curl -s localhost:8090/health | grep '"status":"UP"' diff --git a/graalvm-plugin/src/main/java/io/micronaut/gradle/graalvm/MicronautGraalPlugin.java b/graalvm-plugin/src/main/java/io/micronaut/gradle/graalvm/MicronautGraalPlugin.java index ba62aad8..5aa313c1 100644 --- a/graalvm-plugin/src/main/java/io/micronaut/gradle/graalvm/MicronautGraalPlugin.java +++ b/graalvm-plugin/src/main/java/io/micronaut/gradle/graalvm/MicronautGraalPlugin.java @@ -64,6 +64,7 @@ public void apply(Project project) { inf.getIgnoreExistingResourcesConfigFile().convention(true); inf.getRestrictToProjectDependencies().convention(true); })); + options.jvmArgs("--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED"); Provider richOutput = project.getProviders().systemProperty(RICH_OUTPUT_PROPERTY); if (richOutput.isPresent()) { options.getRichOutput().convention(richOutput.map(Boolean::parseBoolean));