@@ -116,8 +116,9 @@ under the License.
116116 <logback .version>1.6.3</logback .version>
117117 <doclint >none</doclint >
118118 <additionalparam >-Xdoclint:none</additionalparam >
119- <!-- List of add-opens arg line arguments for tests -->
120- <surefire .add-opens.argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</surefire .add-opens.argLine>
119+ <surefire .argLine.extend/>
120+ <surefire .argLine.jdkSpecific/>
121+ <surefire .argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED --enable-native-access=io.netty.common ${surefire.argLine.extend} ${surefire.argLine.jdkSpecific} </surefire .argLine>
121122 <!-- org.apache:apache overrides -->
122123 <minimalJavaBuildVersion >17</minimalJavaBuildVersion >
123124 <maven .compiler.source>17</maven .compiler.source>
@@ -322,7 +323,7 @@ under the License.
322323 <plugin >
323324 <artifactId >maven-surefire-plugin</artifactId >
324325 <configuration >
325- <argLine >${surefire.add-opens. argLine} </argLine >
326+ <argLine >${surefire.argLine} </argLine >
326327 <enableAssertions >true</enableAssertions >
327328 <childDelegation >true</childDelegation >
328329 <forkCount >${forkCount} </forkCount >
@@ -341,7 +342,7 @@ under the License.
341342 <plugin >
342343 <artifactId >maven-failsafe-plugin</artifactId >
343344 <configuration >
344- <argLine >${surefire.add-opens. argLine} </argLine >
345+ <argLine >${surefire.argLine} </argLine >
345346 <systemPropertyVariables >
346347 <java .io.tmpdir>${project.build.directory} </java .io.tmpdir>
347348 <io .netty.tryReflectionSetAccessible>true</io .netty.tryReflectionSetAccessible>
@@ -725,42 +726,6 @@ under the License.
725726 <groupId >org.apache.maven.plugins</groupId >
726727 <artifactId >maven-site-plugin</artifactId >
727728 </plugin >
728- <plugin >
729- <groupId >com.diffplug.spotless</groupId >
730- <artifactId >spotless-maven-plugin</artifactId >
731- <configuration >
732- <pom >
733- <licenseHeader >
734- <file >${maven.multiModuleProjectDirectory} /dev/license/asf-xml.license</file >
735- <delimiter >(< configuration|< project)</delimiter >
736- </licenseHeader >
737- <sortPom />
738- </pom >
739- <java >
740- <googleJavaFormat >
741- <version >1.17.0</version >
742- <style >GOOGLE</style >
743- </googleJavaFormat >
744- <licenseHeader >
745- <file >${maven.multiModuleProjectDirectory} /dev/license/asf-java.license</file >
746- <delimiter >package</delimiter >
747- </licenseHeader >
748- <excludes >
749- <exclude >**/Preconditions.java</exclude >
750- <exclude >**/IntObjectMap.java</exclude >
751- <exclude >**/IntObjectHashMap.java</exclude >
752- </excludes >
753- </java >
754- </configuration >
755- <executions >
756- <execution >
757- <id >spotless-check</id >
758- <goals >
759- <goal >check</goal >
760- </goals >
761- </execution >
762- </executions >
763- </plugin >
764729 </plugins >
765730 <extensions >
766731 <!-- provides os.detected.classifier (i.e. linux-x86_64, osx-x86_64) property -->
@@ -814,6 +779,17 @@ under the License.
814779 </reporting >
815780
816781 <profiles >
782+ <profile >
783+ <!-- Certain flags are required on newer JDK but not recognized on earlier JDK -->
784+ <id >jdk24</id >
785+ <activation >
786+ <jdk >[24,)</jdk >
787+ </activation >
788+ <properties >
789+ <surefire .argLine.jdkSpecific>--sun-misc-unsafe-memory-access=allow</surefire .argLine.jdkSpecific>
790+ </properties >
791+ </profile >
792+
817793 <profile >
818794 <!-- C data interface depends on building a native library -->
819795 <id >arrow-c-data</id >
@@ -842,6 +818,54 @@ under the License.
842818 </properties >
843819 </profile >
844820
821+ <profile >
822+ <!-- google-java-format now requires Java 21+ -->
823+ <id >spotless</id >
824+ <activation >
825+ <jdk >[21,)</jdk >
826+ </activation >
827+ <build >
828+ <plugins >
829+ <plugin >
830+ <groupId >com.diffplug.spotless</groupId >
831+ <artifactId >spotless-maven-plugin</artifactId >
832+ <configuration >
833+ <pom >
834+ <licenseHeader >
835+ <file >${maven.multiModuleProjectDirectory} /dev/license/asf-xml.license</file >
836+ <delimiter >(< configuration|< project)</delimiter >
837+ </licenseHeader >
838+ <sortPom />
839+ </pom >
840+ <java >
841+ <googleJavaFormat >
842+ <version >1.36.1</version >
843+ <style >GOOGLE</style >
844+ </googleJavaFormat >
845+ <licenseHeader >
846+ <file >${maven.multiModuleProjectDirectory} /dev/license/asf-java.license</file >
847+ <delimiter >package</delimiter >
848+ </licenseHeader >
849+ <excludes >
850+ <exclude >**/Preconditions.java</exclude >
851+ <exclude >**/IntObjectMap.java</exclude >
852+ <exclude >**/IntObjectHashMap.java</exclude >
853+ </excludes >
854+ </java >
855+ </configuration >
856+ <executions >
857+ <execution >
858+ <id >spotless-check</id >
859+ <goals >
860+ <goal >check</goal >
861+ </goals >
862+ </execution >
863+ </executions >
864+ </plugin >
865+ </plugins >
866+ </build >
867+ </profile >
868+
845869 <profile >
846870 <!--
847871 Do not activate Error Prone while running with Eclipse/M2E as it causes incompatibilities
0 commit comments