Use the official Gradle release notes as the source of truth for both the
latest version and the wrapper update command:
Always check that page at task time. Do not rely on remembered Gradle versions.
-
Work from the target repository root.
Confirm ./gradlew and gradle/wrapper/gradle-wrapper.properties exist
before changing anything. Inspect git status --short and preserve unrelated
user changes. If Gradle wrapper files are already modified, inspect the diff
and continue only when those edits are part of the same requested Gradle
bump; otherwise ask before overwriting or staging them.
-
Read the latest Gradle version from the release notes.
Open the Upgrade instructions section at the URL above. Use the version in
the release heading and the wrapper command shown there. They should agree;
if they do not, stop and report the mismatch.
-
Run the wrapper update command.
Substitute the version from the release notes:
./gradlew wrapper --gradle-version=GRADLE_VERSION && ./gradlew wrapper
For example, if the release notes say Gradle 9.5.1, run:
./gradlew wrapper --gradle-version=9.5.1 && ./gradlew wrapper
-
Run the build.
./gradlew clean build
If the wrapper update or build fails, do not commit partial changes. Report
the failing command and the relevant error output.
-
Commit only Gradle-related files.
Inspect git status --short and git diff --name-only. Stage only files
created or updated by the Gradle wrapper bump, normally:
gradle/wrapper/gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.jar
gradlew
gradlew.bat
Include other Gradle-owned files only when they are directly required by the
wrapper update and are clearly part of the same change. Do not stage
dependency reports or unrelated build output in this commit.
Commit with the exact subject, replacing GRADLE_VERSION:
Bump Gradle -> `GRADLE_VERSION`
Example:
git commit -m 'Bump Gradle -> `9.5.1`'
If no Gradle-related files changed, do not create an empty commit; report
that the wrapper was already current after verification.
-
Commit dependency reports separately when the build updates them.
Stage only generated dependency report files. In repositories using this
config, the usual paths are:
docs/dependencies/pom.xml
docs/dependencies/dependencies.md
Include other changed files only when they are clearly generated dependency
reports from the build. Commit them separately with:
Update dependency reports
-
Verify the final branch state.
Confirm the recent commit subjects and make sure no owned Gradle bump or
dependency report changes remain unstaged:
git log --format=%s -2
git status --short
Leave unrelated pre-existing user changes alone and mention them separately
in the final response.
-
Ensure version.gradle.kts is bumped.
Before this branch can be built or published locally, the project
version must be strictly greater than the version on the base ref.
Invoke /version-bumped — it is a no-op if a bump has already
happened earlier on the branch, and otherwise calls /bump-version
to perform the increment.