How to include a resource in micronaut graalvm native image with gradle buildNativeLambda

Viewed 350

As described in this guide I am using ./gradlew buildNativeLambda command to generate zip file containing graalvm native image. I am facing a problem described in this thread so wanted to include resource by passing -H:IncludeResources to my command like below:

./gradlew buildNativeLambda -H:IncludeResources="com/amazonaws/partitions/endpoints.json"

Unfortunately, its failing with Unknown command-line option '-H'. How can I pass this to gradle task?

1 Answers

Seems like the right way to do it is though build.gradle file like below:

graalvmNative {
    binaries {
        main {
            buildArgs "-H:IncludeResources=\"com/amazonaws/partitions/endpoints.json\""
        }
    }
}
Related