Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apache-maven/src/bin/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ if "$JAVACMD" --enable-native-access=ALL-UNNAMED -version >/dev/null 2>&1; then
fi
fi

if "$JAVACMD" --sun-misc-unsafe-memory-access=allow -version >/dev/null 2>&1; then
MAVEN_OPTS="--sun-misc-unsafe-memory-access=allow $MAVEN_OPTS"
fi

exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
Expand Down
6 changes: 6 additions & 0 deletions apache-maven/src/bin/mvn.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ if ERRORLEVEL 1 goto skipEnableNativeAccess
set "INTERNAL_MAVEN_OPTS=--enable-native-access=ALL-UNNAMED %INTERNAL_MAVEN_OPTS%"
:skipEnableNativeAccess


"%JAVACMD%" --sun-misc-unsafe-memory-access=allow -version >nul 2>&1
if ERRORLEVEL 1 goto skipSunMemoryAccess
set "INTERNAL_MAVEN_OPTS=--sun-misc-unsafe-memory-access=allow %INTERNAL_MAVEN_OPTS%"
:skipSunMemoryAccess

"%JAVACMD%" ^
%JVM_CONFIG_MAVEN_PROPS% ^
%INTERNAL_MAVEN_OPTS% ^
Expand Down