Scrivio Interview library
LeadershipAdvanced7 min read · updated 12 November 2026

Your organisation has 150 Gradle builds on versions spread over four major releases, and some builds cannot run on the current JDK. How would you set and enforce an upgrade policy?

I would define a supported window, for example the current and previous Gradle major versions, aligned with the JDK versions we support, and publish it with dates. To make it achievable, plugin versions and conventions live in shared convention plugins so many builds upgrade with one change, Renovate or Dependabot propose wrapper upgrades and run each build, a dashboard tracks every repository's Gradle and JDK versions, and we fund help for the laggards. Gradle toolchains separate the JDK that compiles and tests the code from the JDK that runs Gradle, which removes the most common reason builds cannot move.

Why this question is asked

When 150 builds are spread across four Gradle major versions, every platform change has to be tested four ways, security fixes in plugins cannot reach the old builds, and some builds cannot even start on the JDK the company now installs. A policy that just says everyone must upgrade does not fix that; teams need a reason, a deadline and very little work per upgrade. Interviewers ask this to see whether a leader can design a policy that is enforceable because it is cheap to follow. In this answer, we will define the supported window, centralise the parts that make upgrades expensive, automate the upgrades, track and enforce them, and use toolchains to untangle Gradle from the project's JDK.

1Why Builds End Up Four Versions Apart

Builds fall behind for ordinary reasons. Each team upgrades only when something forces it. A plugin with a hard-coded old API blocks the next major. A build copied from an old template keeps its old wrapper. And the JDK is tangled into the decision: an old Gradle version can only run on the JDKs that existed when it was released, so when the company's CI images move to Java 25, builds on an old Gradle cannot start at all, and a team that just wanted to change a line of code now faces a two-major upgrade.

So the problem is not that teams do not care. It is that each upgrade is a unique, manual project. The policy has to make upgrades routine and mostly automatic, and only then enforce a deadline.

2Defining the Supported Window

The policy itself should be short. Supported Gradle versions are the current major and the previous major, on their latest minor release. Supported JDKs for running builds and compiling code follow the company's Java policy, for example Java 21 and 25. When Gradle releases a new major, the oldest supported major gets an end-of-support date, say six months later. After that date, the platform team no longer tests shared plugins or CI templates against it.

Aligning the window with JDK support matters because the two constrain each other. Gradle publishes a compatibility matrix that says which Java versions each Gradle version can run on and which it can compile for. Choosing the window so that every supported Gradle runs on every supported CI JDK keeps CI images simple.

An example policy, published with dates
ItemRuleExample
Supported GradleCurrent and previous major, latest minor9.x and 8.14.x
End of supportSix months after a new major shipsAnnounced with the date
JDK to run GradleCompany-supported JDKs on CI imagesJava 21 and 25
JDK to compile and testSet per build with a toolchainJava 21 or 25
Shared pluginsTested on every supported GradleCI matrix in build-logic
Version numbers are examples; the policy names the rule, the dashboard the current values.

3Making Upgrades Cheap: Centralise the Expensive Parts

Most of the work in a Gradle upgrade is not the wrapper; it is plugins and custom build logic. If 150 builds each pin their own plugin versions and each have their own copy of shared configuration, the upgrade has to be done 150 times. If they all apply a few shared convention plugins, published from a build-logic repository, then the platform team upgrades plugin versions and fixes deprecations once, tests the convention plugins against both supported Gradle versions, and releases a new version.

Each repository then needs two changes: the new convention plugin version and the new wrapper version. Both are one-line changes that a bot can make.

Step throughWhat a repository owns and what the platform owns
  1. Repository build scriptapplies myorg.spring-service, lists dependencies
  2. Gradle wrapperversion bumped by a bot
  3. Shared convention pluginsplugin versions, conventions; tested on supported Gradle
  4. Toolchain settingthe JDK that compiles and tests, independent of Gradle

4 layers, from the top down. Step through them one at a time.

The less each repository owns, the cheaper every upgrade is.

4Automating Upgrades and Tracking Them

Renovate and Dependabot both understand Gradle wrapper files and plugin versions. Configured centrally, they open a pull request in each repository when a new Gradle release or convention plugin version appears, and each repository's CI builds and tests it. For most repositories the pull request is green and someone merges it, or it merges automatically if the team allows that for build tooling.

A dashboard closes the loop. A small job scans all 150 repositories, reads gradle-wrapper.properties and the toolchain setting, and shows each repository's Gradle and JDK versions against the policy, with the end-of-support dates. That turns enforcement from opinion into a list: on any day we can see the 12 repositories that are outside the window and why.

Java
# renovate.json in the shared preset (excerpt)
{
"extends": ["config:recommended"],
"packageRules": [
{ "matchManagers": ["gradle-wrapper"], "groupName": "Gradle wrapper" },
{ "matchPackageNames": ["myorg.spring-service", "myorg.java-library"], "groupName": "Build conventions" }
]
}

Check your Renovate version for the exact manager and option names; the idea is a shared preset that every repository extends, so the upgrade rules are themselves centralised.

5Funding the Laggards and Enforcing the Window

Some repositories will not follow the bot: an abandoned plugin, a custom task using removed APIs, or a team with no capacity. These are where the platform team spends its effort, pairing with the team or doing the upgrade for them, because one hard repository costs the platform more in ongoing support than the upgrade itself. Budgeting this help is part of the policy, not an exception to it.

Enforcement then has teeth that are fair. After the end-of-support date, shared CI templates warn and, after a further grace period, fail builds on unsupported Gradle versions, and security reviews flag them. Because upgrades are cheap and help is available, the deadline is reasonable, and teams that miss it have had both the tools and the support.

6Using Toolchains to Separate Gradle From the Project JDK

Many builds are stuck because the JDK that runs Gradle and the JDK that compiles the code are treated as one. Gradle toolchains split them. The build declares the language version it compiles and tests with, and Gradle finds a matching JDK installed on the machine or downloads one through a toolchain resolver plugin, while Gradle itself runs on whatever supported JDK the CI image provides.

Java
// build.gradle.kts, usually set by the convention plugin
java {
toolchain { languageVersion = JavaLanguageVersion.of(21) } // compile and test with Java 21
}
// settings.gradle.kts: allow Gradle to download a missing JDK
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" // check the current version
}
// CI image runs Gradle on Java 25; the code is still compiled and tested on Java 21

Notice what this unlocks. A service that must stay on Java 21 for its runtime can still upgrade Gradle to a version that runs on Java 25 CI images, and a service moving to Java 25 changes one number without touching its Gradle version. The two upgrades become independent, so neither blocks the other.

7Follow-up questions

Why not require everyone to be on the latest Gradle at all times?

Because a new major release sometimes needs plugin updates that take a few weeks to appear, and forcing it immediately creates churn with no benefit. A window of current and previous major gives the ecosystem time to catch up while still keeping everyone within one step of current.

How do you handle a build that cannot upgrade because of one plugin?

We treat the plugin as the platform's problem: upgrade it in the shared conventions, replace it, or maintain a temporary internal fork. The repository gets an exception with a date, recorded on the dashboard, so it does not silently become permanent.

What does the dashboard measure besides versions?

Usually also the convention plugin version, deprecation warnings counted from build scans or CI logs, and whether the configuration cache is enabled. Deprecation counts are an early signal of which repositories will struggle with the next major.

8Conclusion

In this answer, we set an upgrade policy for 150 Gradle builds: a supported window of the current and previous major versions aligned with JDK support and published with dates, shared convention plugins so plugin and configuration upgrades happen once, Renovate or Dependabot proposing wrapper and convention upgrades that each repository's CI tests, a dashboard of versions with funded help for the laggards, and enforcement after a grace period. Gradle toolchains make the JDK used to compile and test independent of the JDK running Gradle, so the two upgrades no longer block each other.

What to say in the interviewAbout 90 seconds aloud

Open with

I would make the policy simple and make following it cheap. The rule is a supported window: the current and the previous Gradle major, on their latest minor, aligned with the JDKs the company supports, and when a new major ships the oldest one gets an end-of-support date about six months out.

Then, if they want more

Then I remove the reasons upgrades are expensive. Plugin versions and shared configuration live in a few convention plugins from a build-logic repository, tested against both supported Gradle versions, so the platform team does the hard part of each upgrade once.

Each repository then only needs a new wrapper version and a new convention plugin version, and Renovate or Dependabot opens those pull requests automatically, with the repository's own CI testing them.

A dashboard reads every repo's wrapper and toolchain and shows who is outside the window, and the platform team spends real time helping those laggards, because they are usually stuck on one abandoned plugin or custom task. After the end-of-support date and a grace period, CI templates warn and then fail on unsupported versions.

Finally, toolchains are key for the JDK problem: the build declares the Java version it compiles and tests with, Gradle finds or downloads that JDK, and Gradle itself runs on whatever JDK the CI image has, so upgrading Gradle and upgrading Java stop blocking each other.

About this answer

Last updated
12 November 2026
Versions it names
Java 21, Java 25
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Gradle user manual
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your organisation has 150 Gradle builds on versions spread over four major releases, and...": https://scrivio-interview-library.netlify.app/java/gradle/6bca121dcc/