-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-15755: [Java] Support Java 17 #12941
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
Changes from all commits
acf79bd
865b520
7a050e8
aea2f84
cdfae57
a5f9ef8
53ba8af
439403b
02d22c7
96d3c06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,8 @@ | |
| <forkCount>2</forkCount> | ||
| <checkstyle.failOnViolation>true</checkstyle.failOnViolation> | ||
| <errorprone.javac.version>9+181-r4173-1</errorprone.javac.version> | ||
| <error_prone_core.version>2.13.1</error_prone_core.version> | ||
| <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version> | ||
| </properties> | ||
|
|
||
| <scm> | ||
|
|
@@ -376,7 +378,7 @@ | |
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <version>3.6.2</version> | ||
| <version>${maven-compiler-plugin.version}</version> | ||
| <configuration> | ||
| <annotationProcessorPaths> | ||
| <path> | ||
|
|
@@ -690,7 +692,7 @@ | |
|
|
||
| <profiles> | ||
| <profile> | ||
| <id>java-8</id> | ||
| <id>java-nodoclint</id> | ||
| <activation> | ||
| <jdk>[1.8,)</jdk> | ||
| </activation> | ||
|
|
@@ -729,13 +731,14 @@ | |
| </profile> | ||
|
|
||
| <profile> | ||
| <id>error-prone</id> | ||
| <id>error-prone-jdk8</id> | ||
| <!-- | ||
| Do not activate Error Prone while running with Eclipse/M2E as it causes incompatibilities | ||
| with other annotation processors. | ||
| See https://github.com/jbosstools/m2e-apt/issues/62 for details | ||
| --> | ||
| <activation> | ||
| <jdk>1.8</jdk> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, we already have a 1.8-specific profile below. What's the difference?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed |
||
| <property> | ||
| <name>!m2e.version</name> | ||
| </property> | ||
|
|
@@ -746,9 +749,11 @@ | |
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <configuration> | ||
| <fork>true</fork> | ||
| <compilerArgs combine.children="append"> | ||
| <arg>-XDcompilePolicy=simple</arg> | ||
| <arg>-Xplugin:ErrorProne</arg> | ||
| <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${errorprone.javac.version}/javac-${errorprone.javac.version}.jar</arg> | ||
| </compilerArgs> | ||
| <annotationProcessorPaths combine.children="append"> | ||
| <path> | ||
|
|
@@ -764,12 +769,11 @@ | |
| </profile> | ||
|
|
||
| <profile> | ||
| <id>error-prone-jdk8</id> | ||
| <!-- using github.com/google/error-prone-javac is required when running on JDK 8 --> | ||
| <id>error-prone-jdk11+</id> | ||
| <activation> | ||
| <jdk>1.8</jdk> | ||
| <jdk>[11,)</jdk> | ||
| <property> | ||
| <name>!m2e.version</name> | ||
| <name>!m2e.version</name> | ||
| </property> | ||
| </activation> | ||
| <build> | ||
|
|
@@ -778,10 +782,40 @@ | |
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <configuration> | ||
| <fork>true</fork> | ||
| <source>8</source> | ||
| <target>8</target> | ||
| <encoding>UTF-8</encoding> | ||
| <compilerArgs combine.children="append"> | ||
| <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${errorprone.javac.version}/javac-${errorprone.javac.version}.jar</arg> | ||
| <arg>-XDcompilePolicy=simple</arg> | ||
| <arg> | ||
| -Xplugin:ErrorProne \ | ||
| -XepExcludedPaths:.*/(target/generated-sources)/.* | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit, but can these be two separate
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not work on that way. Be aware that when running on JDK 8 the flags cannot be wrapped across multiple lines. JDK 9 and above do allow the flags to be separated by newlines. That is, the second element above can also be formatted as follows on JDK 9+, but not on JDK 8:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, weird. |
||
| </arg> | ||
| <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> | ||
| <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> | ||
| <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> | ||
| <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> | ||
| <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> | ||
| <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> | ||
| <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> | ||
| <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> | ||
| <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> | ||
| <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> | ||
|
Comment on lines
+794
to
+803
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this change mean that consumers of this library will still need to pass
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two part on this question:
Please let me know if you have some additional doubts.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add point (2) to the docs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hi Team, just send this PR to update Arrow JavaSE17/18 documentation. Please if you could review that, thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @davisusanibar It looks like this is a half-finished solution because VM arguments should be considered a temporary solution. Is it possible to use ARROW with JDK 17 and not have VM arguments? Every time I see posts with VM arguments I feel a little worried. In JEP-261 there's a warning about the usage of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @iamzafar as per the jar artifacts are exposed as a legacy mode (it means any jar are running in the classpath is consider as a unnamed module) and base on JEP 200 The Modular JDK: yes, this is needed: Yes, this is an intermediate step: (1) Legacy mode (already implemented, (2) single module and (3) multi-module will be the last steps. This is a draft for implement JPMS and be more restrict about to not give ALL-UNNAMED access but there is a lot of discussion we need to close before to convert this draft into PR: #13072. This is the document that I am going to send for discussion to the ML. |
||
| </compilerArgs> | ||
| <annotationProcessorPaths combine.children="append"> | ||
| <path> | ||
| <groupId>com.google.errorprone</groupId> | ||
| <artifactId>error_prone_core</artifactId> | ||
| <version>${error_prone_core.version}</version> | ||
| </path> | ||
| </annotationProcessorPaths> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <configuration> | ||
| <argLine>--add-opens=java.base/java.nio=ALL-UNNAMED</argLine> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
|
|
||
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.
Can we add a brief comment about why we need to exclude these?
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.
Yes, the reason is
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message: Found Banned Dependency: commons-logging:commons-logging:jar:1.1.3. Let me add some message on the exclude tag.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.
Ah, I didn't realize we had a bannedDependencies set. Ok, it's probably fine to leave this as is then.
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.
Though uh wow, that's been there since the initial Arrow commit in 2016. Are we sure Hadoop functions without this dependency, incidentally?
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.
Unit test is working without problems in JSE 8, JSE 11 but not in JSE 17, that is the reason because we added now.