-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Force to build on JDK 11+ #23550
Force to build on JDK 11+ #23550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I checked CI.
Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (default-cli) on project shardingsphere: Execution default-cli of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument failed : Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified path /usr/lib/jvm/temurin- 11-jdk-amd64/../lib/tools.jar -> [Help 1]
- It looks like
tools.jar
is being called somewhere, which is a unique built-in JAR on JDK 8.
Yeah, I'm taking a look at it. |
unfortunately it seem that |
|
Codecov Report
@@ Coverage Diff @@
## master #23550 +/- ##
============================================
+ Coverage 49.75% 50.22% +0.47%
+ Complexity 2510 1610 -900
============================================
Files 4110 3228 -882
Lines 58609 53626 -4983
Branches 10134 9764 -370
============================================
- Hits 29158 26934 -2224
+ Misses 26930 24324 -2606
+ Partials 2521 2368 -153
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@terrymanu @TeslaCN can you take a review? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please hold on, I need some time to double check
Hi @zhfeng @linghengqian |
Sorry, I thought the antlr |
pom.xml
Outdated
@@ -944,7 +944,7 @@ | |||
<version>${maven.version.range}</version> | |||
</requireMavenVersion> | |||
<requireJavaVersion> | |||
<version>${java.version}</version> | |||
<version>11</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just keep the origin version here, otherwise we have to add -Denforcer.skip=true
to do any other operations with Java 8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can. But It cuould confuse people that building with Java 8 will fail after upgrading antlr to 4.10.1. Anyway, we need to add a NOTE in README to mention that Building from source
of shardingsphere must use JDK 11
above. @terrymanu WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compile should in JDK 11 (release for JDK 8) only.
I prefer to create compile java version
and release java version
properties to separate the different versions.
66b761a
to
cbf02c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think the problem that CI had were solved. You can try to rebase the branch.
Thanks @linghengqian and I will take care of the conflicts after the Chinese New Year holiday. |
pom.xml
Outdated
@@ -944,7 +945,7 @@ | |||
<version>${maven.version.range}</version> | |||
</requireMavenVersion> | |||
<requireJavaVersion> | |||
<version>${java.version}</version> | |||
<version>${compile.java.version}</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @zhfeng
I prefer to set 8
as requireJavaVersion
. Java 11 is required only when compiling parser modules.
Sometimes we just need to compile a part of modules (such as protocol, agent), build an image, do some tests, which could be done using Java 8. Adding -Denforcer.skip=true
is not elegant.
And the error of compiling antlr 4.10+ with Java 8 is clear enough for developers.
We could clarify Java requirement in Wiki and docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is it possible to add maven-enforcer-plugin
with Java 11 requirement to those modules require Java 11? The other modules keep using Java 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it makes sense and I will investigate.
cbf02c3
to
8e30fe0
Compare
Hi guys, I just update to run CI build on JDK 11 but test it on JDK 8.
|
@TeslaCN @terrymanu can you take a review of these changes? I agree to clarify JDK requirement on wiki and docs. Only the modules which uses
any thought? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@zhfeng LGTM, thank you! |
It sould be helpful to fix #19990 and #20935
Changes proposed in this pull request:
JDK 11
above to build shardingsphereJDK 8
to make sure there is no compatitable issues.antlr-maven-plugin
to generate the parser classes. The antlr Tool are only forJDK 11
after upgrading to 4.10.1. So if upgradingantlr
, it will force user to build shardingsphere withJDK 11
It seems that we need to support
JDK 8
for a long time. There is no such plan to drop it, see the relevant discussion https://lists.apache.org/thread/kgtfx5vnw73o61lkvdshyfvjfvvzk3jsBefore committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e
.