Commit 28ed59ca authored by Stephane Nicoll's avatar Stephane Nicoll

Polish contribution

Closes gh-6645
parent 3cccc732
......@@ -77,7 +77,7 @@ public class RunProcess {
protected int run(boolean waitForProcess, Collection<String> args)
throws IOException {
ProcessBuilder builder = new ProcessBuilder(this.command);
builder.directory(workingDirectory);
builder.directory(this.workingDirectory);
builder.command().addAll(args);
builder.redirectErrorStream(true);
boolean inheritedIO = inheritIO(builder);
......
......@@ -88,8 +88,9 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
private Boolean noverify;
/**
* The working directory of the application. If specified by default the process
* will be started by forking a new JVM.
* Current working directory to use for the application. If not specified, basedir
* will be used NOTE: the use of working directory means that processes will be
* started by forking a new JVM.
* @since 1.5
*/
@Parameter(property = "run.workingDirectory")
......
......@@ -16,8 +16,8 @@
package org.springframework.boot.maven;
import java.net.URL;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.List;
......
/*
* Copyright 2012-2015 the original author or authors.
* Copyright 2012-2016 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.
......@@ -90,7 +90,7 @@ public class StartMojo extends AbstractRunMojo {
@Override
protected void runWithForkedJvm(File workingDirectory, List<String> args)
throws MojoExecutionException, MojoFailureException {
RunProcess runProcess = runProcess(args, workingDirectory);
RunProcess runProcess = runProcess(workingDirectory, args);
try {
waitForSpringApplication();
}
......@@ -104,9 +104,11 @@ public class StartMojo extends AbstractRunMojo {
}
}
private RunProcess runProcess(List<String> args, File workingDirectory) throws MojoExecutionException {
private RunProcess runProcess(File workingDirectory, List<String> args)
throws MojoExecutionException {
try {
RunProcess runProcess = new RunProcess(workingDirectory, new JavaExecutable().toString());
RunProcess runProcess = new RunProcess(workingDirectory,
new JavaExecutable().toString());
runProcess.run(false, args.toArray(new String[args.size()]));
return runProcess;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment