Skip to content

Commit

Permalink
HADOOP-19219. Add JPMS options required by hadoop-common (#7084) Cont…
Browse files Browse the repository at this point in the history
…ributed by Cheng Pan.

Reviewed-by: Steve Loughran <[email protected]>
Signed-off-by: Shilun Fan <[email protected]>
  • Loading branch information
pan3793 authored Oct 2, 2024
1 parent e9ed21c commit 3f637ef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,19 @@ function hadoop_finalize_hadoop_opts
hadoop_add_param HADOOP_OPTS hadoop.security.logger "-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER}"
}

## @description Finish configuring JPMS that enforced for JDK 17 and higher
## @description prior to executing Java
## @audience private
## @stability evolving
## @replaceable yes
function hadoop_finalize_jpms_opts
{
hadoop_add_param HADOOP_OPTS IgnoreUnrecognizedVMOptions "-XX:+IgnoreUnrecognizedVMOptions"
hadoop_add_param HADOOP_OPTS open.java.util.zip "--add-opens=java.base/java.util.zip=ALL-UNNAMED"
hadoop_add_param HADOOP_OPTS open.sun.security.util "--add-opens=java.base/sun.security.util=ALL-UNNAMED"
hadoop_add_param HADOOP_OPTS open.sun.security.x509 "--add-opens=java.base/sun.security.x509=ALL-UNNAMED"
}

## @description Finish Java classpath prior to execution
## @audience private
## @stability evolving
Expand Down Expand Up @@ -1597,6 +1610,7 @@ function hadoop_finalize
hadoop_finalize_libpaths
hadoop_finalize_hadoop_heap
hadoop_finalize_hadoop_opts
hadoop_finalize_jpms_opts

hadoop_translate_cygwin_path HADOOP_HOME
hadoop_translate_cygwin_path HADOOP_CONF_DIR
Expand Down
8 changes: 7 additions & 1 deletion hadoop-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,14 @@
<enforced.java.version>[${javac.version},)</enforced.java.version>
<enforced.maven.version>[3.3.0,)</enforced.maven.version>

<extraJavaTestArgs>
-XX:+IgnoreUnrecognizedVMOptions
--add-opens=java.base/java.util.zip=ALL-UNNAMED
--add-opens=java.base/sun.security.util=ALL-UNNAMED
--add-opens=java.base/sun.security.x509=ALL-UNNAMED
</extraJavaTestArgs>
<!-- Plugin versions and config -->
<maven-surefire-plugin.argLine>-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError</maven-surefire-plugin.argLine>
<maven-surefire-plugin.argLine>-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError ${extraJavaTestArgs}</maven-surefire-plugin.argLine>
<maven-surefire-plugin.version>3.0.0-M1</maven-surefire-plugin.version>
<maven-surefire-report-plugin.version>${maven-surefire-plugin.version}</maven-surefire-report-plugin.version>
<maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>
Expand Down

0 comments on commit 3f637ef

Please sign in to comment.