Skip to content

Commit

Permalink
KEYCLOAK-19392 pass infinispan javaVmArguments via JAVA_OPTS instead …
Browse files Browse the repository at this point in the history
…of CLI parameters
  • Loading branch information
tkyjovsk authored and stianst committed Oct 5, 2021
1 parent 24a6b77 commit 01a0e11
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,23 @@ public void start() throws LifecycleException {
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();
Expand Down

0 comments on commit 01a0e11

Please sign in to comment.