为什么我会收到警告 "This build used outdated Gradle functions, which makes it incompatible with Gradle 8.0"。?
Why do I get the warning "This build used outdated Gradle functions, which makes it incompatible with Gradle 8.0".?
当运行 --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.3/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main for more details.
但是我不用这个参数,我用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'
}
}
正如评论中猜到的那样,弃用警告来自 javafx 问题。关于这个有一个open issue:
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?
当运行 --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.3/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main for more details.
但是我不用这个参数,我用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'
}
}
正如评论中猜到的那样,弃用警告来自 javafx 问题。关于这个有一个open issue:
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?