JAVA_OPTS are not set under Windows

* enabled the delayed expansion in order to propagate JAVA_OPTS outside the block

Closes #28207

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
This commit is contained in:
Peter Zaoral 2024-04-04 12:53:05 +02:00 committed by Alexander Schwartz
parent b5535ac970
commit ebeb001fe9

View file

@ -71,6 +71,9 @@ shift
goto READ-ARGS goto READ-ARGS
:MAIN :MAIN
setlocal EnableDelayedExpansion
if not "x%JAVA_OPTS%" == "x" ( if not "x%JAVA_OPTS%" == "x" (
echo "JAVA_OPTS already set in environment; overriding default settings" echo "JAVA_OPTS already set in environment; overriding default settings"
) else ( ) else (
@ -83,15 +86,15 @@ if not "x%JAVA_OPTS%" == "x" (
if "x%JAVA_OPTS_KC_HEAP%" == "x" ( if "x%JAVA_OPTS_KC_HEAP%" == "x" (
set "JAVA_OPTS_KC_HEAP=-XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20" set "JAVA_OPTS_KC_HEAP=-XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20"
if "%KC_RUN_IN_CONTAINER%" == "true" ( if "!KC_RUN_IN_CONTAINER!" == "true" (
rem Maximum utilization of the heap is set to 70% of the total container memory rem Maximum utilization of the heap is set to 70% of the total container memory
rem Initial heap size is set to 50% of the total container memory in order to reduce GC executions rem Initial heap size is set to 50% of the total container memory in order to reduce GC executions
set "JAVA_OPTS_KC_HEAP=%JAVA_OPTS_KC_HEAP% -XX:MaxRAMPercentage=70 -XX:MinRAMPercentage=70 -XX:InitialRAMPercentage=50" set "JAVA_OPTS_KC_HEAP=!JAVA_OPTS_KC_HEAP! -XX:MaxRAMPercentage=70 -XX:MinRAMPercentage=70 -XX:InitialRAMPercentage=50"
) else ( ) else (
set "JAVA_OPTS_KC_HEAP=%JAVA_OPTS_KC_HEAP% -Xms64m -Xmx512m" set "JAVA_OPTS_KC_HEAP=!JAVA_OPTS_KC_HEAP! -Xms64m -Xmx512m"
) )
set "JAVA_OPTS=%JAVA_OPTS% %JAVA_OPTS_KC_HEAP%" set "JAVA_OPTS=!JAVA_OPTS! !JAVA_OPTS_KC_HEAP!"
) else ( ) else (
echo "JAVA_OPTS_KC_HEAP already set in environment; overriding default settings" echo "JAVA_OPTS_KC_HEAP already set in environment; overriding default settings"
) )
@ -166,8 +169,6 @@ set CLASSPATH_OPTS="%DIRNAME%..\lib\quarkus-run.jar"
set JAVA_RUN_OPTS=%JAVA_OPTS% -Dkc.home.dir="%DIRNAME%.." -Djboss.server.config.dir="%DIRNAME%..\conf" -Dkeycloak.theme.dir="%DIRNAME%..\themes" %SERVER_OPTS% -cp %CLASSPATH_OPTS% io.quarkus.bootstrap.runner.QuarkusEntryPoint %CONFIG_ARGS% set JAVA_RUN_OPTS=%JAVA_OPTS% -Dkc.home.dir="%DIRNAME%.." -Djboss.server.config.dir="%DIRNAME%..\conf" -Dkeycloak.theme.dir="%DIRNAME%..\themes" %SERVER_OPTS% -cp %CLASSPATH_OPTS% io.quarkus.bootstrap.runner.QuarkusEntryPoint %CONFIG_ARGS%
SetLocal EnableDelayedExpansion
set OPTIMIZED_OPTION=--optimized set OPTIMIZED_OPTION=--optimized
set HELP_LONG_OPTION=--help set HELP_LONG_OPTION=--help
set BUILD_OPTION=build set BUILD_OPTION=build