in arthur-impl/src/main/java/org/apache/geronimo/arthur/impl/nativeimage/process/ProcessExecutor.java [34:61]
public void run() {
if (log.isDebugEnabled()) {
log.debug("Launching {}", command);
}
Process process = null;
try {
final ProcessBuilder builder = new ProcessBuilder(command);
if (env != null) {
builder.environment().putAll(env);
}
if (inheritIO) {
builder.inheritIO();
}
process = builder.start();
final int exitCode = process.waitFor();
if (exitCode != 0) {
throw new IllegalArgumentException("Invalid exit code: " + exitCode);
}
} catch (final InterruptedException e) {
if (process.isAlive()) {
process.destroyForcibly();
}
Thread.currentThread().interrupt();
} catch (final IOException e) {
throw new IllegalStateException(e);
}
}