This commit is contained in:
Phillip Webb
2016-10-11 22:21:03 -07:00
parent d3e06c4627
commit d818a09ed8
27 changed files with 100 additions and 102 deletions

View File

@@ -149,8 +149,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
/**
* Flag to indicate if the run processes should be forked. {@code fork} is
* automatically enabled if an agent, jvmArguments or working directory are
* specified, or if devtools is present.
* automatically enabled if an agent, jvmArguments or working directory are specified,
* or if devtools is present.
* @since 1.2
*/
@Parameter(property = "fork")
@@ -206,7 +206,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
}
private boolean hasWorkingDirectorySet() {
return (this.workingDirectory != null);
return this.workingDirectory != null;
}
private void findAgent() {

View File

@@ -64,9 +64,11 @@ public class RunMojo extends AbstractRunMojo {
}
@Override
protected void runWithForkedJvm(File workingDirectory, List<String> args) throws MojoExecutionException {
protected void runWithForkedJvm(File workingDirectory, List<String> args)
throws MojoExecutionException {
try {
RunProcess runProcess = new RunProcess(workingDirectory, new JavaExecutable().toString());
RunProcess runProcess = new RunProcess(workingDirectory,
new JavaExecutable().toString());
Runtime.getRuntime()
.addShutdownHook(new Thread(new RunProcessKiller(runProcess)));
int exitCode = runProcess.run(true, args.toArray(new String[args.size()]));