micronaut-starter
micronaut-starter copied to clipboard
Shared metadata service cannot be set to collect metadata gradle task in the starter-analytics-postgres module
Description
The GraalVMReachabilityMetadataService
instance is created and set to the CollectReachabilityMetadata
task in the first evaluated module (which is micronaut-cli
) and then set to CollectReachabilityMetadata
tasks created for other modules. But gradle execution fails to set the shared GraalVMReachabilityMetadataService
instance in the starter-analytics-postgres
because the GraalVMReachabilityMetadataService
class from the starter-analytics-postgres
module is loaded by different class loader. If the build.gradle.kts
file is modified to build.gradle
in the starter-analytics-postgres
module, everything works ok, otherwise the following error is thrown:
Caused by: java.lang.IllegalArgumentException: Cannot set the value of task ':starter-analytics-postgres:collectReachabilityMetadata' property 'metadataService' of type org.graalvm.buildtools.gradle.internal.GraalVMReachabilityMetadataService using a provider of type org.graalvm.buildtools.gradle.internal.GraalVMReachabilityMetadataService.
at org.gradle.api.internal.provider.AbstractMinimalProvider.asSupplier(AbstractMinimalProvider.java:154)
at org.gradle.api.internal.provider.DefaultProperty.set(DefaultProperty.java:100)
at org.graalvm.buildtools.gradle.NativeImagePlugin.lambda$configureJavaProject$11(NativeImagePlugin.java:298)
Steps to Reproduce
Execute ./gradlew tasks --no-daemon --all | grep -w "nativeTest"
in the micronaut-starter