What's New in Gradle 8.0
Gradle 8.0 delivers meaningful upgrades that improve build speed, make scripts easier to write, and prepare projects for modern Java and Kotlin. Configuration cache moves closer to everyday use with better parallelism and plugin support. Kotlin DSL scripts compile faster, Java toolchains get more reliable provisioning, and new ways to organize tests and dependencies cut down on repetition. Performance tweaks like quicker incremental compilation and cross-platform cache hits help large builds run smoother. This version also aligns the ecosystem with newer Java releases and Kotlin features while cleaning up some older APIs. Overall, it's a solid step toward more productive and consistent builds without huge disruptions for most teams.
Configuration Cache Enhancements
Configuration cache, which speeds up repeated builds by storing the configuration phase, becomes opt-in and much more capable in 8.0. It now enables parallel task execution even on the first run when the cache misses, reducing build times noticeably. Behavior stays consistent between cache miss and hit builds, making it easier to test and debug.
More core plugins work with it out of the box, including gradle init, ANTLR, and Groovy DSL precompiled scripts. These changes build on earlier experimental support and set the stage for it becoming the default in future releases.
Kotlin DSL Improvements
Kotlin DSL gets a big performance lift. An interpreter handles the declarative plugins {} block in .gradle.kts files, speeding up script compilation by around 20 percent when you use the supported constrained syntax.
plugins {
java
kotlin("jvm") version "1.8.0"
}
The DSL upgrades to Kotlin API level 1.8, unlocking language and library features added since 1.4. Scripts can now use the Java version of the JVM running Gradle, so you get access to newer Java features in build logic. Precompiled script plugins follow your configured Java toolchain or fall back to Java 8.
Java Toolchains and Provisioning
Java toolchains become more robust. Gradle no longer auto-provisions toolchains by default -- you need to declare a repository explicitly, usually with the Foojay resolver plugin.
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0"
}
You can configure specific versions, vendors, and implementations for consistent builds across machines. Build scans now show toolchain details too.
Test Suites and Version Catalogs
The new JvmTestSuite plugin simplifies managing different test types like unit, integration, or functional tests. Define them declaratively in the testing.suites block and wire them into lifecycle tasks.
testing {
suites {
integrationTest(JvmTestSuite) {
useJUnitJupiter("5.7.1")
dependencies {
implementation project()
}
}
}
}
tasks.named("check") {
dependsOn(testing.suites.integrationTest)
}
Version catalogs expand to include plugin versions in libs.versions.toml. You declare them under a [plugins] section and reference by alias in the plugins block, making centralized dependency management even cleaner.
Performance and Compilation Wins
Incremental Java compilation improves with faster analysis, lower memory use, and better cache handling. Changes to constants no longer force full recompiles -- only affected classes rebuild. Line endings normalize during compilation for more cross-OS cache hits.
Continuous build uses native file watching on Windows and macOS (Java 9+), cutting delay from up to 10 seconds to near-instant change detection. PMD plugin runs in parallel using worker API and toolchains for quicker static analysis.
buildSrc and Tooling Changes
buildSrc acts more like included builds: run its tasks from the command line, include other builds inside it, and skip automatic test runs unless you ask. Init scripts now apply to buildSrc too.
Kotlin DSL gains type-safe accessors for custom repository extensions in the repositories {} block, reducing the need for Groovy-style builders.
Ecosystem and Compatibility Updates
Gradle supports Java 17 through 19 for compilation, testing, and execution. Groovy 4.0 is ready for builds (though Groovy DSL scripts still use Groovy 3). Scala Zinc compiler updates to 1.6.1 for finer incremental compilation.
Deprecations, Removals, and Breaking Changes
Several deprecated APIs from earlier versions are removed. Kotlin DSL requires Kotlin 1.8 API level, which includes some breaking changes -- review the upgrade guide. Type-unsafe version catalog access changes to accept alias strings directly. Java toolchain provisioning needs explicit setup. Check the 7.x to 8.0 upgrade guide for full migration steps and any plugin updates needed.
Upgrade Notes
Start by updating to Gradle 7.6.1 first, run a build with --scan to spot deprecations, update plugins, then move to 8.0. Use the wrapper command: ./gradlew wrapper --gradle-version=8.0. Test configuration cache early with --configuration-cache. Most projects upgrade smoothly after addressing Kotlin 1.8 changes and toolchain setup. The speed gains from faster scripts, better caching, and parallel execution make it worth the effort for medium to large builds.