Deprecated Gradle features warnings

I’ve been seeing a warning in my build scripts like this:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0

I’ve reproduced this in a basic JavaFX app and to get some additional information I’ve run the following:

./gradlew run --warning-mode all --stacktrace

> Configure project :
Project : => 'com.mycompany.app' Java module
The AbstractCompile.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 9.0. Please use the destinationDirectory property instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.4-rc-1/userguide/upgrading_version_7.html#compile_task_wiring
        at org.gradle.api.tasks.compile.AbstractCompile.getDestinationDir(AbstractCompile.java:90)
        at org.gradle.api.tasks.compile.JavaCompile_Decorated.getDestinationDir(Unknown Source)
        at org.javamodularity.moduleplugin.tasks.MergeClassesHelper$GradleTaskWrapper.getDestinationDir(MergeClassesHelper.java:131)
        at org.javamodularity.moduleplugin.tasks.MergeClassesTask.lambda$configureMergeClassesAfterEvaluate$2(MergeClassesTask.java:32)
        at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411)
        at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)

I’ve truncated the stack trace, but to me the cause of the deprecation warning is coming from the gradle task.

Is anyone else seeing this and is this a bug?

No, the deprecation warning is logged by getDestinationDir, but the problem is the one calling that method.
In your case it is the Java Modularity plugin.
I would anyway recommend to not use it, but to use the built-in JPMS support.
If you don’t apply the plugin manually, you should update the JavaFX plugin, as from 0.1.0 on it does not auto-apply the Java Modularity plugin anymore.

Hi @Vampire

Yes that was exactly the problem. I wasn’t using the Java Modularity plugin, but the JavaFX plugin 0.0.14 was the cause, Switching to 0.1.0 as you point out resolves the warning messages.

I’m ready for Gradle 9!

Thanks

1 Like