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

Updated build.gradle to allow mantis-common-serde to be compiled using JDK 17 #387

Closed

Conversation

Adithya2907
Copy link

Context

Upgrade JDK version to 17. This PR upgrades the mantis-common-serde module.
Part of #355

  • When using JDK 17, the gradle build process fails since spotlessJava fails. This is because google-java-format is broken on JDK 16+, and we use this package indirectly while formatting the code.
  • The reason for the error is because a few packages that google-java-format uses are not exported by the JDK from JDK 16 onwards.
  • A work around for this has been proposed here which I've implemented on the build.gradle file.
  • Since this workaround specifically targets JDK 16+, the build process fails when compiling the whole project using JDK 8, when we run ./gradlew build. Therefore, to ensure the flags are added only when target is JDK 17, if(JavaVersion.current() != JavaVersion.VERSION_1_8) has been created inside of which we add the required workaround flags.

Screenshot of successful building of mantis-common-serde module using JDK 17

Screenshot 2023-03-29 at 3 30 29 PM

Checklist

  • ./gradlew build compiles code correctly
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable

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.

None yet

2 participants