Skip to content

Commit e70b468

Browse files
committed
HBASE-27870 Eliminate the 'WARNING: package jdk.internal.util.random not in java.base' when running UTs with jdk11 (#5242)
Signed-off-by: Tianhang Tang <tianhang@apache.org> (cherry picked from commit 71d7996)
1 parent 2fc7358 commit e70b468

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

pom.xml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,18 @@
708708
"-Djava.library.path=${hadoop.library.path};${java.library.path}"
709709
-Dorg.apache.hbase.thirdparty.io.netty.leakDetection.level=advanced
710710
-Dio.opentelemetry.context.enableStrictContext=true</hbase-surefire.cygwin-argLine>
711+
<hbase-surefire.jdk11.flags>-Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true
712+
--add-modules jdk.unsupported
713+
--add-opens java.base/java.nio=ALL-UNNAMED
714+
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
715+
--add-opens java.base/java.lang=ALL-UNNAMED
716+
--add-opens java.base/jdk.internal.ref=ALL-UNNAMED
717+
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
718+
--add-opens java.base/java.util=ALL-UNNAMED
719+
--add-opens java.base/java.util.concurrent=ALL-UNNAMED
720+
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED
721+
--add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED</hbase-surefire.jdk11.flags>
722+
<hbase-surefire.jdk17.flags>--add-opens java.base/jdk.internal.util.random=ALL-UNNAMED</hbase-surefire.jdk17.flags>
711723
<!-- Surefire argLine defaults to Linux, cygwin argLine is used in the os.windows profile -->
712724
<argLine>${hbase-surefire.argLine} @{jacocoArgLine}</argLine>
713725
<extra.enforcer.version>1.5.1</extra.enforcer.version>
@@ -2899,18 +2911,7 @@
28992911
<properties>
29002912
<maven.compiler.release>${releaseTarget}</maven.compiler.release>
29012913
<!-- TODO: replicate logic for windows support -->
2902-
<argLine>-Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true
2903-
--add-modules jdk.unsupported
2904-
--add-opens java.base/java.nio=ALL-UNNAMED
2905-
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
2906-
--add-opens java.base/java.lang=ALL-UNNAMED
2907-
--add-opens java.base/jdk.internal.ref=ALL-UNNAMED
2908-
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
2909-
--add-opens java.base/java.util=ALL-UNNAMED
2910-
--add-opens java.base/java.util.concurrent=ALL-UNNAMED
2911-
--add-opens java.base/jdk.internal.util.random=ALL-UNNAMED
2912-
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED
2913-
--add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED
2914+
<argLine>${hbase-surefire.jdk11.flags}
29142915
${hbase-surefire.argLine}
29152916
@{jacocoArgLine}</argLine>
29162917
<!--
@@ -2979,6 +2980,18 @@
29792980
</plugins>
29802981
</build>
29812982
</profile>
2983+
<profile>
2984+
<id>build-with-jdk17</id>
2985+
<activation>
2986+
<jdk>[17,)</jdk>
2987+
</activation>
2988+
<properties>
2989+
<argLine>${hbase-surefire.jdk11.flags}
2990+
${hbase-surefire.jdk17.flags}
2991+
${hbase-surefire.argLine}
2992+
@{jacocoArgLine}</argLine>
2993+
</properties>
2994+
</profile>
29822995
<!-- profile activated by the Jenkins patch testing job -->
29832996
<profile>
29842997
<id>jenkins.patch</id>

0 commit comments

Comments
 (0)