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

Polish contribution

Closes gh-6645
parent 3cccc732
...@@ -77,7 +77,7 @@ public class RunProcess { ...@@ -77,7 +77,7 @@ public class RunProcess {
protected int run(boolean waitForProcess, Collection<String> args) protected int run(boolean waitForProcess, Collection<String> args)
throws IOException { throws IOException {
ProcessBuilder builder = new ProcessBuilder(this.command); ProcessBuilder builder = new ProcessBuilder(this.command);
builder.directory(workingDirectory); builder.directory(this.workingDirectory);
builder.command().addAll(args); builder.command().addAll(args);
builder.redirectErrorStream(true); builder.redirectErrorStream(true);
boolean inheritedIO = inheritIO(builder); boolean inheritedIO = inheritIO(builder);
......
...@@ -88,8 +88,9 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { ...@@ -88,8 +88,9 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
private Boolean noverify; private Boolean noverify;
/** /**
* The working directory of the application. If specified by default the process * Current working directory to use for the application. If not specified, basedir
* will be started by forking a new JVM. * will be used NOTE: the use of working directory means that processes will be
* started by forking a new JVM.
* @since 1.5 * @since 1.5
*/ */
@Parameter(property = "run.workingDirectory") @Parameter(property = "run.workingDirectory")
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
package org.springframework.boot.maven; package org.springframework.boot.maven;
import java.net.URL;
import java.io.File; import java.io.File;
import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.util.List; 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -90,7 +90,7 @@ public class StartMojo extends AbstractRunMojo { ...@@ -90,7 +90,7 @@ public class StartMojo extends AbstractRunMojo {
@Override @Override
protected void runWithForkedJvm(File workingDirectory, List<String> args) protected void runWithForkedJvm(File workingDirectory, List<String> args)
throws MojoExecutionException, MojoFailureException { throws MojoExecutionException, MojoFailureException {
RunProcess runProcess = runProcess(args, workingDirectory); RunProcess runProcess = runProcess(workingDirectory, args);
try { try {
waitForSpringApplication(); waitForSpringApplication();
} }
...@@ -104,9 +104,11 @@ public class StartMojo extends AbstractRunMojo { ...@@ -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 { 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()])); runProcess.run(false, args.toArray(new String[args.size()]));
return runProcess; 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