Gradle
27 questions in 9 subtopics.
Tasks and the build lifecycle
Describe Gradle's initialization, configuration and execution phases. Why is doing work like reading files or calling the network at configuration time a problem?What is the difference betweentasks.register("x") and tasks.create("x") in Gradle, and why does it matter for large builds?How does Gradle decide that a task is UP-TO-DATE, and what mistakes in custom tasks cause it to rerun every time or, worse, to skip when it should run?Ten years from now your build scripts will be maintained by people who did not write them. What principles would you set for Gradle build code today?Configurations
In a Gradle Java library, what is the difference between api, implementation,compileOnly and runtimeOnly configurations?Gradle resolves jackson-databind to 2.17 but a module was tested with 2.15 and a library needs 2.18. Explain Gradle's default conflict resolution and the tools to control and inspect it.Your internal library is consumed by 80 Gradle services. Explain how you decide what goes into api versus implementation, and how you prevent the library from forcing versions onto consumers.Kotlin DSL
Why have many teams moved Gradle builds from Groovy DSL to Kotlin DSL, and what are the costs?Show how you would replace a 'subprojects { ... }' block that configures Java version, test settings and Checkstyle for all modules with a Kotlin DSL convention plugin.Build cache and incremental builds
What is the difference between Gradle incremental builds (UP-TO-DATE) and the build cache (FROM-CACHE)?Your team set up a remote Gradle build cache but CI hit rates stay below 20 percent. What causes cache misses and how do you investigate?Build time across your 300-engineer Java organisation is a growing complaint. How would you justify and roll out remote build caching and other build performance investments?Over five years, build infrastructure (remote cache, build scans, CI agents) can cost as much as a small product team. How would you decide how much to invest in Gradle build performance, and how would you keep the investment from decaying?Version catalogs
What does a Gradle version catalog look like and how is it used from a build script?A team asks whether a version catalog replaces the Spring Boot BOM. Explain the difference between a version catalog and a platform.You want 60 Gradle repositories to share dependency versions and build conventions. Compare publishing a shared version catalog, a platform, and a set of convention plugins, and propose a combination.Multi-project builds
How does a Gradle multi-project build work: what doessettings.gradle.kts do, and how does one subproject depend on another?When would you use a Gradle composite build (includeBuild) instead of adding projects to one multi-project build?Your company standardised on Maven a decade ago; several teams now want Gradle. How do you decide whether to allow two build tools, migrate, or keep one?Migrating from Maven
You need to migrate a single-module Maven project with Spring Boot, a few plugins and a parent POM to Gradle. What steps would you take and what usually goes wrong?A 40-module Maven build takes 25 minutes and the team wants Gradle for the build cache. How would you plan and de-risk the migration?Half of your 200 repositories use Maven and half use Gradle, and the platform team maintains duplicate tooling for both. Would you mandate one build tool, and how would you decide?Gradle versions and upgrades
What is the Gradle wrapper, why should every project use it, and how do you upgrade Gradle safely?After upgrading Gradle by one major version, the build fails with errors about removed APIs in a third-party plugin and the configuration cache reports many problems. How do you get the upgrade done?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?Gradle setup and IDE integration
How do IntelliJ IDEA and Eclipse integrate with a Gradle build, and what are Java toolchains for?New developers need half a day to get a large Gradle project building in their IDE: wrong JDK, missing credentials for the private repository, and slow imports. How do you improve the setup?No question matches these choices.