Skip to content

Commit a18384b

Browse files
authored
KAFKA-19756 Add documentation for Gradle version upgrade process (#20741)
Currently, there is no documentation describing how to upgrade Gradle in the Kafka project. The upgrade process involves updating three separate configuration files with specific checksums and URLs, which can be error-prone without clear guidance. - Added a new "Upgrading Gradle version" section to README.md - Documents the 3-step process for upgrading Gradle: - Update Gradle version in gradle/dependencies.gradle - Update wrapper JAR checksum in wrapper.gradle - Regenerate the `gradle-wrapper.properties` and the wrapper script Reviewers: Ken Huang <[email protected]>, PoAn Yang <[email protected]>, Ming-Yen Chung <[email protected]>, Chia-Ping Tsai <[email protected]>
1 parent aaadb2b commit a18384b

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ only safe if the Scala library version is the same at compile time and runtime.
271271
may depend on the kafka jar for integration tests where they may include a scala library with a different version), we don't enable it by
272272
default. See https://www.lightbend.com/blog/scala-inliner-optimizer for more details.
273273

274+
### Upgrading Gradle version ###
275+
276+
See [gradle/wrapper/README.md](gradle/wrapper/README.md) for instructions on upgrading the Gradle version.
277+
274278
### Running system tests ###
275279

276280
See [tests/README.md](tests/README.md).

gradle/wrapper/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Gradle Wrapper
2+
3+
This directory contains the Gradle wrapper files for the Apache Kafka project.
4+
5+
## Upgrading Gradle version
6+
7+
When upgrading the Gradle version used by the Kafka project, update the following files in order:
8+
9+
1. **Update Gradle version** in `gradle/dependencies.gradle`:
10+
```groovy
11+
gradle: "9.2.0"
12+
```
13+
14+
2. **Update wrapper JAR checksum** in `wrapper.gradle`:
15+
- Find the ***Wrapper JAR Checksum*** at https://gradle.org/release-checksums/
16+
- Update the `wrapperChecksum` variable:
17+
```groovy
18+
task bootstrapWrapper() {
19+
// ... (other code)
20+
doLast {
21+
// ... (other code)
22+
String wrapperChecksum = "<wrapper-jar-sha256-checksum>"
23+
// ...
24+
}
25+
}
26+
```
27+
- Verify the wrapper JAR URL is accessible at:
28+
`https://raw.githubusercontent.com/gradle/gradle/v<gradle-version>/gradle/wrapper/gradle-wrapper.jar`
29+
30+
31+
3. **Regenerate the `gradle/wrapper/gradle-wrapper.properties` and the wrapper script**:
32+
- Find the ***Binary-only (-bin) ZIP Checksum*** for the binary distribution at https://gradle.org/release-checksums/
33+
34+
```shell
35+
./gradlew wrapper --gradle-version <gradle-version> \
36+
--distribution-type bin \
37+
--gradle-distribution-sha256-sum <binary-distribution-checksum>
38+
```
39+
40+
After upgrading, verify the Gradle version:
41+
42+
./gradlew --version

0 commit comments

Comments
 (0)