Skip to content

Conversation

@joshua2519
Copy link
Contributor

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 4-step process for upgrading Gradle:
    a. Update Gradle version in gradle/dependencies.gradle
    b. Update distribution checksums in gradle/wrapper/gradle-wrapper.properties
    c. Update wrapper JAR checksum in wrapper.gradle
    d. Regenerate the wrapper script using ./gradlew wrapper
  • References official Gradle release checksums at https://gradle.org/release-checksums/
  • Includes verification steps and URL validation guidance

@github-actions github-actions bot added docs small Small PRs triage PRs from the community labels Oct 21, 2025
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
default. See https://www.lightbend.com/blog/scala-inliner-optimizer for more details.

### Upgrading Gradle version ###
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving the docs to gradle/wrapper?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved to gradle/wrapper and left a simple reference link to it.
WDYT

@github-actions github-actions bot added the build Gradle build or GitHub Actions label Oct 21, 2025
- Verify the wrapper JAR URL is accessible at:
`https://raw.githubusercontent.com/gradle/gradle/v<VERSION>/gradle/wrapper/gradle-wrapper.jar`

4. **Regenerate the wrapper script**:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just out of curiosity, should we also update the checksum in the gradlew file?

kafka/gradlew

Line 204 in 05999c7

REQUIRED_WRAPPER_JAR_CHECKSUM="76805e32c009c0cf0dd5d206bddc9fb22ea42e84db904b764f3047de095493f3"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to manually update the checksum in the gradlew file. When we run ./gradlew wrapper, it regenerates the gradlew based on the configuration in wrapper.gradle.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your explanation!

@github-actions github-actions bot removed the triage PRs from the community label Oct 22, 2025
Copy link
Collaborator

@mingyen066 mingyen066 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. Left some comments.

distributionSha256Sum=<sha256-checksum-from-release-page>
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
```
- Verify the distribution URL is accessible
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure why this verification is needed.
The link distribution URL in https://services.gradle.org/distributions/ will be accessible.


3. **Update wrapper JAR checksum** in `wrapper.gradle`:
- Find the Wrapper JAR Checksum at https://gradle.org/release-checksums/
- Update the `wrapperChecksum` variable (line 42):
Copy link
Collaborator

@mingyen066 mingyen066 Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't hardcode the line number here as it might change in the future.
How about:

Suggested change
- Update the `wrapperChecksum` variable (line 42):
- Update the `wrapperChecksum` variable:
```groovy
task bootstrapWrapper() {
...
doLast {
...
String wrapperChecksum = "<wrapper-jar-sha256-checksum>"

2. **Update distribution checksums** in `gradle/wrapper/gradle-wrapper.properties`:
- Find the SHA256 checksum for the binary distribution at https://gradle.org/release-checksums/
- Update `distributionSha256Sum` with the Binary-only (-bin) ZIP Checksum
- Update `distributionUrl` to point to the new version:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Update `distributionUrl` to point to the new version:
- Update `distributionUrl` to use the latest version from `https://services.gradle.org/distributions/`:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions ci-approved docs small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants