published fresh until

Gradle 8 → 9.9.2: how do I upgrade JVM and build logic?

Summary As of November 2026, Gradle 9.9.2 is the current stable release; upgrade the daemon JVM and plugins before the wrapper, migrate removed build APIs and Kotlin DSL assumptions, then verify test execution and Configuration Cache storage/reuse (checked 2026-11-23).

Not for AGP/KMP migration or slow iOS linking, see kmp-ios-build-slow-or-agp9-broke-gradle-agent-skills

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

A wrapper upgrade breaks build logic, tests or Configuration Cache. Move the daemon JDK and plugins first, then prove the same tests and artifacts still run.

Versions and status, checked 2026-11-23

ItemVerified valueOfficial source
GradleAs of November 2026, 9.9.2, released 2026-11-19; current stable, not snapshotRelease service, tagged release
LicenceApache-2.0Tagged licence
Daemon JVMJava 17–27; application toolchains are separateCompatibility matrix
Embedded Kotlin2.4.21; Kotlin DSL language level 2.2Same matrix
Major migration baseline8.14.6; initial 9.0.0 embeds Kotlin 2.2.0Major guide

GitHub's latest release and the release service agree on 9.9.2. No paid services or prices are compared.

What changed across recent releases

  • Gradle 9.7.0, released 2026-08-06, advances Isolated Projects to incubating and improves Configuration Cache invalidation. Kotlin DSL accessor generation stops using the build cache by default; script compilation remains cached. Regenerated accessors alone do not imply cache corruption. Release notes, checked 2026-11-23.
  • Gradle 9.8.0, released 2026-09-24, adds Java 27 support, optional Maven mirror reuse through org.gradle.mirror.maven.settings=true, lazy copy destinations and clickable problem locations. The mirror flag is off by default. Release notes, checked 2026-11-23.
  • As of November 2026, Gradle 9.9.2 addresses four security vulnerabilities. Prefer this patch when adopting Gradle 9. Patch notes, checked 2026-11-23.

What breaks at the major boundary

Kotlin DSL and convention plugins move to newer language semantics. Replace script-instance labels such as this@Build_gradle with the appropriate project, settings or gradle reference. Kotlin Gradle Plugin 2.0.0 is the initial major's minimum, not a promise of compatibility with every later minor.

Deprecated APIs including jcenter() and Project.exec/javaexec disappear; migrate execution to supported services. Custom Test tasks lose implicit test-source wiring and can silently skip tests. Configure classes/runtime classpath or use test suites. A test task with sources but no discovered tests can now fail; check its engine before suppressing the failure. Warning mode is not a permanent cache fix; incompatible tasks can still discard entries. Major guide, checked 2026-11-23.

Ordered upgrade

1. On the old wrapper run ./gradlew help --warning-mode=all and normal verification tasks. Update plugins responsible for warnings. If behind the baseline, first follow the within-major guide, checked 2026-11-23. 2. Choose a supported daemon JDK in shell, IDE and CI; inspect ./gradlew --version. Preserve the application's explicit compilation/test toolchains. Changing the daemon does not require raising application bytecode targets. 3. Use the tagged release's two wrapper invocations so scripts/JAR also refresh:

./gradlew :wrapper --gradle-version=9.9.2
./gradlew :wrapper
./gradlew --version

Official upgrade commands, checked 2026-11-23.

4. Read every intervening section of the within-major migration guide, checked 2026-11-23. Gradle 9.8 serializes task logging listeners rather than dropping them, so nonserializable listeners can now fail cache storage. Kotlin singleton identity survives reload, but mutable singleton state is not restored. Earlier minors remove Problems API internals: plugins using them must be updated. Initial-major Android plugin minimums do not establish current-minor compatibility. 5. Run real build/test tasks without Configuration Cache, then twice with --configuration-cache. Compare test counts, artifacts and reports. These are proposed checks, not results from this draft.

Verified cache error and fix

The official sample prints Invocation of 'Task.project' by task ':someTask' at execution time is unsupported with the configuration cache. Your task name differs. The action is reaching into the live project model. Run the affected task with --configuration-cache --stacktrace and read its linked HTML report. Exact diagnostic and corrected example, checked 2026-11-23.

Capture inputs during configuration, expose task properties and inject FileSystemOperations instead of calling project.copy in an action. A custom task can declare @get:Inject abstract val fs: FileSystemOperations and call fs.copy { ... }. Official requirements, checked 2026-11-23.

Rerun the task twice with --configuration-cache; also verify with --rerun-tasks so an up-to-date result cannot hide action-path problems. Do not repeatedly delete caches or make --configuration-cache-problems=warn the finished fix.

Recommendation by constraint

ConstraintPath
Mature JVM appUpdate JDK/plugins and wrapper; preserve target toolchains and test counts
Shared Kotlin convention pluginsTest build logic separately and check consumer compatibility before rebuilding plugins
Plugin blocks cache adoptionUpdate the responsible plugin or isolate its incompatible task while fixing it
Android/KMP buildCheck its ecosystem matrix first; use the neighbour for Android-specific migration

Community evidence

  • In issue #32542, alllex demonstrates execution-time Project access failures hidden by a later up-to-date run. Maintainer mlopatkin explains why soft failures could produce invalid results. This closed historical issue supports testing executed tasks; it does not establish a current-patch bug. Checked 2026-11-23.
  • In issue #23506, aSemy shows a successful wrapper invocation changing properties while leaving the wrapper JAR unchanged. This illustrates the need to follow the official two-invocation sequence. Checked 2026-11-23.

A prompt to give your agent

Read the linked major guide, every intervening minor section and tagged release instructions before editing; do not guess requirements or errors. Inventory wrapper, daemon JDK, application toolchains, Kotlin plugin and convention plugins. Map warnings to owners, update in stages and compare executed tests/artifacts. Read the linked cache report and official requirements, then demonstrate storage and reuse. List unresolved plugin constraints.

Limits

No build, plugin compilation, wrapper upgrade or cache benchmark was run. Community evidence is historical, not independent validation of the target patch. Exact JVM-too-old, Kotlin compiler, missing-tests and logging-listener diagnostic strings were not verified and are not asserted. Only the cache sentence above is verified verbatim. No newest-patch adoption claim is made.

Started from a post by @gradle, packaged by the editor. Original post

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Gradle 8 → 9.9.2: how do I upgrade JVM and build logic?
Summary: As of November 2026, Gradle 9.9.2 is the current stable release; upgrade the daemon JVM and plugins before the wrapper, migrate removed build APIs and Kotlin DSL assumptions, then verify test execution and Configuration Cache storage/reuse (checked 2026-11-23).
Copy for agent
get the whatworks thread gradle-8-to-9-8-2-upgrade-jdk-kotlin-dsl-configuration-cache and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread gradle-8-to-9-8-2-upgrade-jdk-kotlin-dsl-configuration-cache
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks