Revert "Add start/stop goals to maven plugin"

This reverts commit 54e12a07e6.
This commit is contained in:
Phillip Webb
2015-04-16 12:32:06 -07:00
parent 2085a5b0cf
commit a8d099f6b8
25 changed files with 382 additions and 1918 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2015 the original author or authors.
* Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@ import org.springframework.util.ReflectionUtils;
* @author Phillip Webb
* @author Dave Syer
* @author Andy Wilkinson
* @author Stephane Nicoll
* @since 1.1.0
*/
public class RunProcess {
@@ -51,18 +50,11 @@ public class RunProcess {
this.command = command;
}
public int run(boolean waitForProcess, String... args) throws IOException {
return run(waitForProcess, Arrays.asList(args));
public int run(String... args) throws IOException {
return run(Arrays.asList(args));
}
/**
* Kill this process.
*/
public void kill() {
doKill();
}
protected int run(boolean waitForProcess, Collection<String> args) throws IOException {
protected int run(Collection<String> args) throws IOException {
ProcessBuilder builder = new ProcessBuilder(this.command);
builder.command().addAll(args);
builder.redirectErrorStream(true);
@@ -79,22 +71,17 @@ public class RunProcess {
handleSigInt();
}
});
if (waitForProcess) {
try {
return process.waitFor();
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
return 1;
}
try {
return process.waitFor();
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
return 1;
}
return 5;
}
finally {
if (waitForProcess) {
this.endTime = System.currentTimeMillis();
this.process = null;
}
this.endTime = System.currentTimeMillis();
this.process = null;
}
}
@@ -176,11 +163,7 @@ public class RunProcess {
if (hasJustEnded()) {
return true;
}
return doKill();
}
private boolean doKill() {
// destroy the running process
Process process = this.process;
if (process != null) {