Skip to content
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

Fix the sample applications to be able to build with Java 21 #71

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

KodaiD
Copy link
Contributor

@KodaiD KodaiD commented Sep 11, 2024

Description

Our sample applications should be able to built with the Java versions we support (Java 8, 11, 17, 21).

As a result of PR #70, our examples now work with Java 8, 11 and 17. However, most ScalarDB sample applications use Gradle 7.6 that does not support Java 21.

To address this issue, I try to upgrade the version of Gradle to 8.5 in this PR. I also try to eliminate the docker plugin that is not compatible with all Java versions we support.

Related issues and/or PRs

Changes made

  • Upgrade the version of Gradle to 8.5
  • Remove docker plugin

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

@KodaiD
Copy link
Contributor Author

KodaiD commented Sep 11, 2024

Regarding d1f68f1, all I did is only the following:

-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip

Other differences were automatically generated when executing the gradle command.

@KodaiD
Copy link
Contributor Author

KodaiD commented Sep 11, 2024

I've confirmed that the all samples are able to build with Java 21. I've also confirmed that I can run/try microservice-transaction-sample and spring-data-microservice-transaction-sample following their documents.

@brfrn169
Copy link
Collaborator

@KodaiD So, unlike the ScalarDL samples, we don't need to use Toolchain in the ScalarDB samples. Is my understanding correct? If yes, what’s the difference?

@KodaiD
Copy link
Contributor Author

KodaiD commented Sep 11, 2024

@KodaiD So, unlike the ScalarDL samples, we don't need to use Toolchain in the ScalarDB samples. Is my understanding correct? If yes, what’s the difference?

@brfrn169 Strictly speaking, we don't need to use the toolchain in both the ScalarDB sample and ScalarDL sample. But, in the update of ScalarDL sample, I tried to remove all warnings appearing when we built it.

sourceCompatibility and targetCompatibility seem to be deprecated, and the following error appears when building.

> Task :compileJava
警告: [options] ソース値8は廃止されていて、今後のリリースで削除される予定です
警告: [options] ターゲット値8は廃止されていて、今後のリリースで削除される予定です

Of course I can fix the sample to use the toolchain instead, but I think this it's outside the scope of this PR (I think the main target of this PR is making the sample to be able to build on Java 21).

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@brfrn169
Copy link
Collaborator

@KodaiD Thank you for answering my question.

Of course I can fix the sample to use the toolchain instead, but I think this it's outside the scope of this PR (I think the main target of this PR is making the sample to be able to build on Java 21).

I think we should fix the samples to use the toolchain for consistency. Let's do that in a separate PR. Thanks.

Copy link
Collaborator

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Copy link
Contributor

@kota2and3kan kota2and3kan left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

FYI: I didn't test all samples, but I was able to run the ./gradlew docker command under the spring-data-microservice-transaction-sample/ directory by using Java 8, 11, 17, and 21 in my local environment.

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@feeblefakie feeblefakie merged commit 8b97cd3 into main Sep 19, 2024
@feeblefakie feeblefakie deleted the fix-sample-to-build-with-java21 branch September 19, 2024 23:39
@KodaiD KodaiD mentioned this pull request Oct 9, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants