public class Exec
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
Exec.OutputBufferThread |
OutputBufferThread is a background thread for consuming and storing output
of the external process.
|
| Constructor | 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 | Description |
|---|---|---|
static void |
addEnvironment(java.lang.ProcessBuilder pb,
java.util.Map<java.lang.String,java.lang.String> env) |
Add environment variables to a ProcessBuilder.
|
static java.lang.String |
envToString(java.util.Map<java.lang.String,java.lang.String> env) |
Pretty-print the environment to a StringBuilder.
|
int |
run(java.util.List<java.lang.String> command,
java.util.List<java.lang.String> output) |
Runs the specified command and saves each line of the command's output to
the given list.
|
int |
run(java.util.List<java.lang.String> command,
java.util.List<java.lang.String> output,
java.util.List<java.lang.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(java.util.List<java.lang.String> command,
java.util.List<java.lang.String> output)
command - List containing command and all argumentsoutput - List in/out parameter to receive command outputpublic int run(java.util.List<java.lang.String> command,
java.util.List<java.lang.String> output,
java.util.List<java.lang.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(java.lang.ProcessBuilder pb,
java.util.Map<java.lang.String,java.lang.String> env)
pb - The ProcessBuilderenv - A map of environment variable names to values.public static java.lang.String envToString(java.util.Map<java.lang.String,java.lang.String> env)
env - A map of environment variable names to values to print.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.