Skip to content

Commit 22b7f30

Browse files
committed
HBASE-29602 Add -Djava.security.manager=allow to JDK18+ surefire JVM flags
1 parent 0f11bec commit 22b7f30

1 file changed

Lines changed: 50 additions & 1 deletion

File tree

pom.xml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,13 @@
10521052
--add-opens java.base/sun.security.x509=ALL-UNNAMED
10531053
--add-opens java.base/sun.security.util=ALL-UNNAMED
10541054
--add-opens java.base/java.net=ALL-UNNAMED</hbase-surefire.jdk17.flags>
1055+
<!-- Java 18+ disables the Security Manager by default. Hadoop 3.4.2 and earlier doesn't work
1056+
without Security Manager.
1057+
When Hadoop 3.5.0 is released and HBase adds support for it, this can be removed, or moved
1058+
to a Hadoop version dependent profile.
1059+
This is NOT added to the startup scripts, as this is a major change, and the user better be
1060+
aware of this requirement and add this in hbase-env.sh and/or in their application -->
1061+
<hbase-surefire.jdk18.flags>-Djava.security.manager=allow</hbase-surefire.jdk18.flags>
10551062
<!-- Surefire argLine defaults to Linux, cygwin argLine is used in the os.windows profile -->
10561063
<argLine>${hbase-surefire.argLine} @{jacocoArgLine}</argLine>
10571064
<extra.enforcer.version>1.5.1</extra.enforcer.version>
@@ -3531,10 +3538,52 @@
35313538
35323539
-->
35333540
<profiles>
3541+
<profile>
3542+
<id>build-with-jdk18</id>
3543+
<activation>
3544+
<jdk>[18,)</jdk>
3545+
</activation>
3546+
<properties>
3547+
<maven.compiler.release>${releaseTarget}</maven.compiler.release>
3548+
<argLine>${hbase-surefire.jdk18.flags}
3549+
${hbase-surefire.jdk17.flags}
3550+
${hbase-surefire.argLine}
3551+
@{jacocoArgLine}</argLine>
3552+
<!--
3553+
Value to use for surefire when running jdk11.
3554+
TODO: replicate logic for windows
3555+
-->
3556+
<surefire.Xmx>2200m</surefire.Xmx>
3557+
</properties>
3558+
<build>
3559+
<pluginManagement>
3560+
<plugins>
3561+
<plugin>
3562+
<groupId>org.apache.maven.plugins</groupId>
3563+
<artifactId>maven-javadoc-plugin</artifactId>
3564+
<version>${maven.javadoc.version}</version>
3565+
<configuration>
3566+
<source>${compileSource}</source>
3567+
<!--
3568+
Need to add this option to ignore the source errors, epsecially that we reference
3569+
test code in hbase-testing-util's main code.
3570+
-->
3571+
<additionalOptions>--ignore-source-errors</additionalOptions>
3572+
<additionalJOptions>
3573+
<additionalJOption>-J-Xmx2G</additionalJOption>
3574+
<additionalJOption>-J--add-exports</additionalJOption>
3575+
<additionalJOption>-Jjdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED</additionalJOption>
3576+
</additionalJOptions>
3577+
</configuration>
3578+
</plugin>
3579+
</plugins>
3580+
</pluginManagement>
3581+
</build>
3582+
</profile>
35343583
<profile>
35353584
<id>build-with-jdk17</id>
35363585
<activation>
3537-
<jdk>[17,)</jdk>
3586+
<jdk>[17,18)</jdk>
35383587
</activation>
35393588
<properties>
35403589
<maven.compiler.release>${releaseTarget}</maven.compiler.release>

0 commit comments

Comments
 (0)