lidavidm commented on code in PR #43381:
URL: https://github.com/apache/arrow/pull/43381#discussion_r1687460046


##########
java/pom.xml:
##########
@@ -1274,5 +1274,70 @@ under the License.
         </plugins>
       </build>
     </profile>
+
+    <!-- Cross java version test profiles -->
+    <profile>
+      <id>cross-jdk-testing</id>
+      <activation>
+        <property>
+          <name>arrow.test.jdk-version</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-enforcer-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>check-jdk-version-property</id>
+                <goals>
+                  <goal>enforce</goal>
+                </goals>
+                <phase>validate</phase>
+                <configuration>
+                  <rules>
+                    <requireProperty>
+                      <property>arrow.test.jdk-version</property>
+                      <message>"JDK version used for test must be 
specified."</message>
+                      <regex>^\d{2,}</regex>
+                      <regexMessage>"JDK version used for test must 11, 17, 
21, ..."</regexMessage>
+                    </requireProperty>
+                  </rules>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!--
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-toolchains-plugin</artifactId>
+            <configuration>
+              <jdk>
+                <version>${arrow.test.jdk-version}</version>
+              </jdk>
+            </configuration>
+          </plugin>
+          -->

Review Comment:
   Did you mean to leave this commented out?



##########
docs/source/developers/java/building.rst:
##########
@@ -321,6 +321,54 @@ Building Java JNI Modules
           -Darrow.c.jni.dist.dir=<absolute path to your arrow 
folder>/java-dist/lib/ \
           -Parrow-jni clean install
 
+Testing
+=======
+
+By default, Maven uses the same Java version to both build the code and run 
the tests.
+
+It is also possible to use a different JDK version for the tests. This 
requires Maven
+toolchains to be configured beforehand, and then a specific test property 
needs to be set.
+
+Configuring Maven toolchains
+----------------------------
+
+To be able to use a JDK versionfor testing, it needs to be registered first in 
Maven ``toolchains.xml``

Review Comment:
   ```suggestion
   To be able to use a JDK version for testing, it needs to be registered first 
in Maven ``toolchains.xml``
   ```



-- 
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