prepareMergedJarsDir using deprecated "Invocation of Task.project at execution time"
According to Gradle 9, this is deprecated in Gradle 10. It gives the following message:
> Task :prepareMergedJarsDir
Invocation of Task.project at execution time has been deprecated. This will fail with an error in Gradle 10. This API is incompatible with the configuration cache, which will become the only mode supported by Gradle in a future release. Consult the upgrading guide for further information: https://docs.gradle.org/9.1.0/userguide/upgrading_version_7.html#task_project
Which version of the plugin did you use?
Which version of the plugin did you use?
3.1.3
You can reproduce it with the msgilligan/gradle-jlink-jep-493-sample project.
on macOS:
sdk use gradle 9.1.0
sdk use java 25-tem
gradle jlink --warning-mode all
on aarch64-linux (NixOS), first comment out the vendor = JvmVendorSpec.matching('Eclipse Adoptium') line in build.gradle, then:
nix shell nixpkgs#gradle_9
gradle -PjavaToolchainVersion=21 jlink --warning-mode all
The Nix gradle_9 package for reproducibility reasons configures Gradle to uses a directly-linked OpenJDK 21 (this can be overridden using more advanced configuration, but it is easier to just comment out the line in build.gradle forcing Temurin)
To be clear, I don't this should be a high priority: Gradle 10 won't happen for a while and until it is released, the only thing a fix for this issue will do is remove a warning.