davisusanibar commented on code in PR #12941:
URL: https://github.com/apache/arrow/pull/12941#discussion_r856290120


##########
java/pom.xml:
##########
@@ -777,10 +781,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)/.*
+                </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>

Review Comment:
   There are two part on this question:
   
   1. Changed for arrow side: Changes related to `--add-exports"` are needed to 
continue supporting erroProne base on JSE11+ [installation 
doc](https://errorprone.info/docs/installation). It mean you won't need this 
changes if you run arrow java building code without errorProne validation (mvn 
clean install -P-error-prone-jdk11+ ....)
   
   2. Changes as a user of arrow: If the user are planning to use Arrow with 
JSE17 is needed to pass modules needed. For example if I run cookbook for IO 
https://arrow.apache.org/cookbook/java/io.html it finished with an error 
mention `Unable to make field long java.nio.Buffer.address accessible: module 
java.base does not "opens java.nio" to unnamed module` for that reason as a 
user for JSE17 (not for arrow changes) is needed to add VM arguments as `-ea 
--add-opens=java.base/java.nio=ALL-UNNAMED` and it will finished without errors.
   
   Please let me know if you have some additional doubts.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to