The Gradle Wrapper (gradlew / gradlew.bat) is a script checked into the project that downloads and runs a specific, pinned version of Gradle automatically, so nobody needs a global Gradle installation. It guarantees every developer and CI agent builds with the exact same Gradle version.
Key Points: • The wrapper's version is declared in gradle/wrapper/gradle-wrapper.properties, so the build always uses a consistent, reproducible Gradle version. • Developers don't need to manually install or manage Gradle versions — running ./gradlew build downloads the correct version automatically on first use. • It eliminates "works on my machine" issues caused by different developers or CI agents having different globally installed Gradle versions. • Upgrading Gradle project-wide is as simple as running gradle wrapper --gradle-version <version>, which updates the pinned version for everyone. • The wrapper JAR and scripts should always be committed to version control so the setup is self-contained.
Example: A new developer cloning the repository can immediately run ./gradlew build without installing Gradle at all — the wrapper downloads the exact pinned version specified in the project, guaranteeing it matches what CI uses.
Code Example:
./gradlew buildInterview Tip: A concise interview answer is:
"The Gradle Wrapper pins an exact Gradle version per project and downloads it automatically, so every developer and CI agent builds with the identical version without needing a global install. It removes version-mismatch issues entirely and makes onboarding as simple as running ./gradlew build."