throw new MojoExecutionException("Geronimo installation directory does not exist: " + geronimoHomeStr);
}
log.info("Starting Geronimo client...");
Java java = (Java)createTask("java");
java.setJar(new File(geronimoHome, "bin/client.jar"));
java.setDir(geronimoHome);
java.setFailonerror(true);
java.setFork(true);
if (javaVirtualMachine != null) {
if (!javaVirtualMachine.exists()) {
throw new MojoExecutionException("Java virtual machine is not valid: " + javaVirtualMachine);
}
log.info("Using Java virtual machine: " + javaVirtualMachine);
java.setJvm(javaVirtualMachine.getCanonicalPath());
}
if (timeout > 0) {
java.setTimeout(new Long(timeout * 1000));
}
if (maximumMemory != null) {
java.setMaxmemory(maximumMemory);
}
// Set the properties which we pass to the JVM from the startup script
setSystemProperty(java, "org.apache.geronimo.base.dir", geronimoHome);
setSystemProperty(java, "java.io.tmpdir", "var/temp");
setSystemProperty(java, "java.endorsed.dirs", prefixSystemPath("java.endorsed.dirs", new File(geronimoHome, "lib/endorsed")));
setSystemProperty(java, "java.ext.dirs", prefixSystemPath("java.ext.dirs", new File(geronimoHome, "lib/ext")));
java.createArg().setValue(moduleId);
for (int i=0;arg != null && i<arg.length;i++) {
java.createArg().setValue(arg[i]);
}
if (logOutput) {
File file = getLogFile();
FileUtils.forceMkdir(file.getParentFile());
log.info("Redirecting output to: " + file);
java.setOutput(file);
}
java.execute();
}