public class JavaProcessExecutor extends Object
| Modifier and Type | Field and Description |
|---|---|
private List<String> |
argsList |
private Collection<URL> |
classPathUrls |
private File |
java |
protected List<String> |
jvmArgs |
private Log |
logger |
private boolean |
waitFor |
private File |
workingDirectory |
| Constructor and Description |
|---|
JavaProcessExecutor() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addClasspath(List<String> argsList)
This add or build the classpath that will be passed to the forked process JVM i.e "-cp"
|
private void |
argsLine(Commandline commandline) |
private Commandline |
buildCommandLine() |
Process |
execute() |
private File |
findJava()
An utility to find the Java Executable from the host
|
private void |
redirectOutput(Process process,
Log logger) |
JavaProcessExecutor |
withArgs(List<String> argsList) |
JavaProcessExecutor |
withClassPath(Collection<URL> classPathUrls) |
JavaProcessExecutor |
withJvmOpts(List<String> jvmArgs) |
JavaProcessExecutor |
withLogger(Log logger) |
JavaProcessExecutor |
withWaitFor(boolean waitFor) |
JavaProcessExecutor |
withWorkDirectory(File directory) |
private Log logger
private boolean waitFor
private File workingDirectory
private final File java
private Collection<URL> classPathUrls
private Commandline buildCommandLine() throws Exception
Exceptionprivate void argsLine(Commandline commandline)
public JavaProcessExecutor withArgs(List<String> argsList)
public JavaProcessExecutor withLogger(Log logger)
public JavaProcessExecutor withClassPath(Collection<URL> classPathUrls)
public JavaProcessExecutor withWaitFor(boolean waitFor)
public JavaProcessExecutor withJvmOpts(List<String> jvmArgs)
public JavaProcessExecutor withWorkDirectory(File directory)
private void addClasspath(List<String> argsList) throws MojoExecutionException
argsList - - the forked process argument list to which the classpath will be appendedMojoExecutionException - - any error that might occur while building or adding classpathCopyright © 2018. All rights reserved.