Upgrading to Gradle 10.0.0
This chapter provides the information you need to migrate your Gradle 9.9.3 builds to Gradle 10.0.0. For migrating within Gradle 9.x.y, see the older migration guide first.
| As soon as Gradle 11.0.0 ships, no security or bug fixes will be made on any release of Gradle 9. To receive fixes for these versions, see Gradle Security Subscription. |
We recommend the following steps for all users:
-
Try running
gradle help --scanand view the deprecations view of the generated Build Scan.
This lets you see any deprecation warnings that apply to your build.
Alternatively, you can run
gradle help --warning-mode=allto see the deprecations in the console, though it may not report as much detailed information. -
Update your plugins.
Some plugins may break with a new major version of Gradle, as these releases can remove public APIs. Using the latest version of a plugin increases the likelihood that it is already compatible with the new major Gradle version.
-
Run
gradle :wrapper --gradle-version 10.0.0to update the project to 10.0.0. -
Try to run the project and debug any errors using the Troubleshooting Guide.
Changes in Gradle 10.0.0
| Gradle 10.0.0 is still in development. Breaking changes and removals are added to this chapter as they are made. |
Removed APIs and features
Removal of ProblemSpec.severity() and Severity.ADVICE
Gradle 10.0.0 removes the incubating ProblemSpec.severity() method and the Severity.ADVICE constant from the Problems API.
Both were deprecated in Gradle 9.6.0, when severity() became a no-op and Gradle stopped reporting problems with ADVICE severity.
The reporting method sets the severity: ProblemReporter.report() reports warnings and ProblemReporter.throwing() reports errors, as described in Reporting problems.
Remove any calls to severity() and any references to Severity.ADVICE.
Plugins compiled against earlier Gradle versions that call severity() keep working: Gradle turns the call into a no-op when it loads the plugin.
The Tooling API keeps its own Severity.ADVICE, because Gradle versions before 9.6.0 still report it.
Removal of targetJdk on the PMD plugin
Gradle 10.0.0 removes the targetJdk property from the PMD plugin, which was deprecated in Gradle 9.6.0
This removes:
-
Pmd.getTargetJdk()andPmd.setTargetJdk(TargetJdk) -
PmdExtension.getTargetJdk(),PmdExtension.setTargetJdk(TargetJdk)andPmdExtension.setTargetJdk(Object) -
PmdPlugin.getDefaultTargetJdk(JavaVersion) -
The
TargetJdkenum
The property had no effect for any supported PMD version, since PMD 5.0 and later infer the language version from the rule sets.
Remove any targetJdk configuration from your build.