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

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'
    }
}

Your build is still using the deprecated property even though you’re not using it directly.

In this case, you’re using a plugin (org.openjfx.javafxplugin) that depends on another plugin (org.javamodularity:moduleplugin) that was using it. While the issue was technically fixed in a more recent release of the latter, the former still depends on an older version.

Therefore, you will need to take some action to not use the deprecated property before your build will be compatible with 8.0 when it is released, even if that is just updating plugin versions.

1 Like