Skip to content
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion apache-maven/src/bin/mvn.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,12 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
@REM MNG-8248
"%JAVACMD%" --enable-native-access=ALL-UNNAMED -version >nul 2>&1
if ERRORLEVEL 1 goto skipEnableNativeAccess
set "MAVEN_OPTS=--enable-native-access=ALL-UNNAMED %MAVEN_OPTS%"
set "INTERNAL_MAVEN_OPTS=--enable-native-access=ALL-UNNAMED %INTERNAL_MAVEN_OPTS%"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should expose this new variable. Which means we need to set it to an empty string before trying the line 176, so that a value coming from the user env would not interfere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've pushed a change to clear this variable at the top of the script.

:skipEnableNativeAccess

"%JAVACMD%" ^
%JVM_CONFIG_MAVEN_PROPS% ^
%INTERNAL_MAVEN_OPTS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %CLASSWORLDS_JAR% ^
Expand Down
Loading