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

[SEDONA-211] Enforce release managers to use JDK 8 #724

Merged
merged 10 commits into from
Dec 10, 2022

Conversation

jiayuasu
Copy link
Member

@jiayuasu jiayuasu commented Dec 10, 2022

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

  1. Fix a place in BigBufferedImage to make sure the code is compatible among all Java version >=8
  2. Add docs to enforce the release manager to use JDK 8

My original thought was to use <release>8</release> in the POM. However, this leads to several issues

  • <release>8</release> compiler arg is only available on JDK >=9. We must set multiple POM profiles which only enables this release arg when JDK >=9 is detected on the release manager's environment.
  • Given the complexity of current Sedona pom.xml, adding these 2 new profiles prevents Maven from understanding the Pom structure. Therefore, we cannot add these 2 profiles nor set <release>8</release> as default.

Therefore, I added the instruction to the release manager doc to make sure that one must set mvn to JDK 8 when make a formal release.

If your Maven (mvn --version) points to other JDK versions, you must change it to JDK 8. Steps are as follows:

  1. Find all Java installed on your machine: /usr/libexec/java_home -V. You should see multiple JDK versions including JDK 8.
  2. Run whereis mvn to get the installation location of your Maven. The result is a symlink to the actual location.
  3. Open it in the terminal (with sudo if needed). It will be like this
#!/bin/bash
JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home)}" exec "/usr/local/Cellar/maven/3.6.3/libexec/bin/mvn" "$@"
  1. Change JAVA_HOME:-$(/usr/libexec/java_home)} to JAVA_HOME:-$(/usr/libexec/java_home -v 1.8)}. The resulting content will be like this:
#!/bin/bash
JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home -v 1.8)}" exec "/usr/local/Cellar/maven/3.6.3/libexec/bin/mvn" "$@"
  1. Run mvn --version again. It should now point to JDK 8.

How was this patch tested?

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the docs.

@jiayuasu jiayuasu changed the title [SEDONA-211] Set maven compiler release to 8 [SEDONA-211] Enforce release managers to use JDK 8 Dec 10, 2022
@jiayuasu jiayuasu merged commit a928188 into master Dec 10, 2022
@jiayuasu jiayuasu deleted the SEDONA-211-java-version-to-8 branch December 10, 2022 22:21
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.

None yet

1 participant