Skip to content

Upgrade Gradle to 9 along with JDK and Spotless #880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joonseolee
Copy link

@joonseolee joonseolee commented Aug 7, 2025

Pull Request

Related issue

Fixes #869

What does this PR do?

  • Upgraded JDK and Spotless versions following the Gradle upgrade.

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

Summary by CodeRabbit

  • Chores
    • Upgraded Java compatibility from version 8 to 17.
    • Updated Gradle wrapper to version 9.0.0.
    • Increased Spotless and Google Java Format plugin versions.
    • Updated Docker Compose to use OpenJDK 17 image.
    • Modernized build configuration for improved compatibility.

Copy link
Contributor

coderabbitai bot commented Aug 7, 2025

Walkthrough

The project build configuration was updated to use Gradle 9, Java 17, and newer plugin versions. The Spotless plugin and Google Java Format were upgraded, and Docker Compose now uses OpenJDK 17. Deprecated Gradle properties were replaced with their modern equivalents. No changes were made to source code or public APIs.

Changes

Cohort / File(s) Change Summary
Gradle Build Configuration
build.gradle
Upgraded Spotless plugin (6.13.0 → 6.25.0), Google Java Format (1.7 → 1.10.0, AOSP style), Java 8 → Java 17, and migrated deprecated archivesBaseName to base.archivesName.set().
Gradle Wrapper
gradle/wrapper/gradle-wrapper.properties
Updated Gradle wrapper from 8.14.1 to 9.0.0.
Docker Compose
docker-compose.yml
Updated OpenJDK image from version 11 to 17 for the "package" service.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Gradle Wrapper
    participant Build Plugins
    participant Docker Compose

    Developer->>Gradle Wrapper: Run build/test
    Gradle Wrapper->>Build Plugins: Use Gradle 9, Java 17, Spotless 6.25.0, Google Java Format 1.10.0 (AOSP)
    Developer->>Docker Compose: Start "package" service
    Docker Compose->>Docker: Use OpenJDK 17 image
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Assessment against linked issues

Objective Addressed Explanation
Upgrade Gradle to v9 and resolve related warnings (#869)
Update build and Docker configuration to use compatible Java version (#869)
Migrate deprecated Gradle properties for compatibility (#869)

Poem

A hop and a skip, we leap to nine,
Gradle and Java, now both align!
Spotless is sharper, the Docker’s brand new,
No warnings to chase, just skies so blue.
With paws on the keys, this bunny’s delight—
Our builds are now modern, swift, and light!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
docker-compose.yml (1)

3-3: Pin the JDK image to a fixed patch tag for reproducible builds

azul/zulu-openjdk:17-latest floats to whatever Azul ships next. This can break CI the day a new 17.x patch appears (e.g. 17.0.20 → 17.0.22). Prefer a deterministic tag such as:

-    image: azul/zulu-openjdk:17-latest
+    image: azul/zulu-openjdk:17.0.22

You still get security updates by bumping the tag deliberately and reviewing the diff.

build.gradle (1)

22-24: Avoid duplicated archive naming – keep it in one place

You now set the base archive name twice:

  1. base { archivesName.set('meilisearch-java') } (new)
  2. buildJar { archiveBaseName = 'meilisearch-java' } (existing)

If one of them drifts, you’ll get two differently-named JARs in build/libs. Drop one (prefer the base block) or reference project.archiveBaseName inside the custom task to stay DRY.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34e6053 and 7f9bf6c.

📒 Files selected for processing (3)
  • build.gradle (3 hunks)
  • docker-compose.yml (1 hunks)
  • gradle/wrapper/gradle-wrapper.properties (1 hunks)
🔇 Additional comments (4)
gradle/wrapper/gradle-wrapper.properties (1)

3-3: Confirm wrapper JAR + plugin stack are really Gradle 9-ready

distributionUrl now targets Gradle 9 GA. Make sure:

  1. gradle/wrapper/gradle-wrapper.jar was regenerated (./gradlew wrapper --gradle-version 9.0.0) and committed; otherwise CI will still download the old bootstrapper.
  2. All applied plugins (Spotless 6.25.0, nexus-publish, etc.) were tested against Gradle 9 to catch any runtime incompatibilities early.

A quick smoke-run locally or in CI should surface problems, but please double-check before merging.

build.gradle (3)

16-17: Spotless upgrade looks good

Bumping to 6.25.0 is required for Gradle 9 and has no breaking changes for Java formatters.


123-124: Java 17 target – validate dependency compatibility

Raising sourceCompatibility/targetCompatibility to 17 is aligned with the new Docker image, but a few dependencies (e.g. json:20250517, jackson-databind:2.19.0) historically lag behind latest JDKs. Please run the full test matrix on JDK 17 before merging to ensure no reflective-access or module-system issues surface.


199-199: Formatter bump acknowledged

Updating Google Java Format to 1.10.0 (AOSP) syncs with Spotless 6.x; no concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Gradle v9
1 participant