From 01a0e11c8f56d265e3ae824221e766b2ac7e215e Mon Sep 17 00:00:00 2001 From: Tomas Kyjovsky Date: Mon, 4 Oct 2021 16:33:12 +0200 Subject: [PATCH] KEYCLOAK-19392 pass infinispan javaVmArguments via JAVA_OPTS instead of CLI parameters --- .../InfinispanServerDeployableContainer.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/InfinispanServerDeployableContainer.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/InfinispanServerDeployableContainer.java index bfa71def88..cda985eb15 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/InfinispanServerDeployableContainer.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/InfinispanServerDeployableContainer.java @@ -90,22 +90,23 @@ public class InfinispanServerDeployableContainer implements DeployableContainer< commands.add("-Dcom.sun.management.jmxremote.authenticate=false"); commands.add("-Dcom.sun.management.jmxremote.ssl=false"); - if (configuration.getJavaVmArguments() != null) { - commands.addAll(Arrays.asList(configuration.getJavaVmArguments().split("\\s+"))); - } - ProcessBuilder pb = new ProcessBuilder(commands); pb = pb.directory(new File(configuration.getInfinispanHome(), "/bin")).inheritIO().redirectErrorStream(true); pb.environment().put("LAUNCH_ISPN_IN_BACKGROUND", "false"); pb.environment().put("ISPN_PIDFILE", pidFile.getAbsolutePath()); + if (configuration.getJavaVmArguments() != null) { + pb.environment().put("JAVA_OPTS", configuration.getJavaVmArguments()); + } + String javaHome = configuration.getJavaHome(); if (javaHome != null && !javaHome.isEmpty()) { pb.environment().put("JAVA_HOME", javaHome); } try { log.info("Starting Infinispan server"); - log.info(configuration.getInfinispanHome()); - log.info(commands); + log.infof(" Home directory: %s", configuration.getInfinispanHome()); + log.infof(" Commands: %s", commands); + log.infof(" Environment: %s", pb.environment()); infinispanServerProcess = pb.start(); trustAllCertificates();