Why do I get the warning "This build used outdated Gradle functions, which makes it incompatible with Gradle 8.0".?

Viewed 1985

When running with the --warning-mode all key, I get the following.

The JavaExec.main property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the mainClass property instead. See https://docs.gradle.org/7.3/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main for more details.

But I don't use this parameter, I use mainClass.

build.gradle

plugins {
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.10'
    id 'org.beryx.jlink' version '2.24.4'
}

repositories {
    mavenCentral()
}

application {
    mainModule = 'pigletmodule'
    mainClass = 'piglet.Main'
}

javafx {
    version = "17.0.1"
    modules = ['javafx.controls']
}

jlink {
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    launcher {
        name = 'piglet'
    }
}
1 Answers

As correctly guessed in the comments, the deprecation warning comes from the javafx issue. There is an open issue about this:

In the current stable version, I get warning when I run this.

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

The JavaExec.main property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the mainClass property instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main for more details. It seems the problem of gradle-modules-plugin. Also, in the current version of this plugin, the problem already fixed.

May I fix it and send PR?

Related