public class Exec extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Exec.OutputBufferThread
OutputBufferThread is a background thread for consuming and storing output
of the external process.
|
| Constructor and Description |
|---|
Exec(org.apache.maven.plugin.Mojo mojo)
Creates a new Exec instance for executing an external process from the given
mojo.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addEnvironment(ProcessBuilder pb,
Map<String,String> env)
Add environment variables to a ProcessBuilder.
|
static String |
envToString(Map<String,String> env)
Pretty-print the environment to a StringBuilder.
|
int |
run(List<String> command,
List<String> output)
Runs the specified command and saves each line of the command's output to
the given list.
|
int |
run(List<String> command,
List<String> output,
List<String> errors)
Runs the specified command and saves each line of the command's output to
the given list and each line of the command's stderr to the other list.
|
public Exec(org.apache.maven.plugin.Mojo mojo)
mojo - Mojo executing external processpublic int run(List<String> command, List<String> output)
command - List containing command and all argumentsoutput - List in/out parameter to receive command outputpublic int run(List<String> command, List<String> output, List<String> errors)
command - List containing command and all argumentsoutput - List in/out parameter to receive command outputerrors - List in/out parameter to receive command stderrpublic static void addEnvironment(ProcessBuilder pb, Map<String,String> env)
pb - The ProcessBuilderenv - A map of environment variable names to values.Copyright © 2008–2020 Apache Software Foundation. All rights reserved.