KEYCLOAK-19392 pass infinispan javaVmArguments via JAVA_OPTS instead of CLI parameters
This commit is contained in:
parent
24a6b77fb4
commit
01a0e11c8f
1 changed files with 7 additions and 6 deletions
|
@ -90,22 +90,23 @@ public class InfinispanServerDeployableContainer implements DeployableContainer<
|
||||||
commands.add("-Dcom.sun.management.jmxremote.authenticate=false");
|
commands.add("-Dcom.sun.management.jmxremote.authenticate=false");
|
||||||
commands.add("-Dcom.sun.management.jmxremote.ssl=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);
|
ProcessBuilder pb = new ProcessBuilder(commands);
|
||||||
pb = pb.directory(new File(configuration.getInfinispanHome(), "/bin")).inheritIO().redirectErrorStream(true);
|
pb = pb.directory(new File(configuration.getInfinispanHome(), "/bin")).inheritIO().redirectErrorStream(true);
|
||||||
pb.environment().put("LAUNCH_ISPN_IN_BACKGROUND", "false");
|
pb.environment().put("LAUNCH_ISPN_IN_BACKGROUND", "false");
|
||||||
pb.environment().put("ISPN_PIDFILE", pidFile.getAbsolutePath());
|
pb.environment().put("ISPN_PIDFILE", pidFile.getAbsolutePath());
|
||||||
|
if (configuration.getJavaVmArguments() != null) {
|
||||||
|
pb.environment().put("JAVA_OPTS", configuration.getJavaVmArguments());
|
||||||
|
}
|
||||||
|
|
||||||
String javaHome = configuration.getJavaHome();
|
String javaHome = configuration.getJavaHome();
|
||||||
if (javaHome != null && !javaHome.isEmpty()) {
|
if (javaHome != null && !javaHome.isEmpty()) {
|
||||||
pb.environment().put("JAVA_HOME", javaHome);
|
pb.environment().put("JAVA_HOME", javaHome);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
log.info("Starting Infinispan server");
|
log.info("Starting Infinispan server");
|
||||||
log.info(configuration.getInfinispanHome());
|
log.infof(" Home directory: %s", configuration.getInfinispanHome());
|
||||||
log.info(commands);
|
log.infof(" Commands: %s", commands);
|
||||||
|
log.infof(" Environment: %s", pb.environment());
|
||||||
infinispanServerProcess = pb.start();
|
infinispanServerProcess = pb.start();
|
||||||
|
|
||||||
trustAllCertificates();
|
trustAllCertificates();
|
||||||
|
|
Loading…
Reference in a new issue