diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java index 9b5a17a380853..94edce4e414e9 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java @@ -240,8 +240,9 @@ void build(List staticInitTasks, createAppCDS.returnValue(null); } - // very first thing is to set system props (for run time, which use substitutions for a different - // storage from build-time) + // Make sure we set properties in doStartup as well. This is necessary because setting them in the static-init + // sets them at build-time, on the host JVM, while SVM has substitutions for System. get/ setProperty at + // run-time which will never see those properties unless we also set them at run-time. for (SystemPropertyBuildItem i : properties) { mv.invokeStaticMethod(ofMethod(System.class, "setProperty", String.class, String.class, String.class), mv.load(i.getKey()), mv.load(i.getValue()));