|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.plugin.AbstractMojo org.codehaus.mojo.exec.AbstractExecMojo org.codehaus.mojo.exec.ExecMojo
public class ExecMojo
A Plugin for executing external programs.
Field Summary | |
---|---|
private List |
arguments
Can be of type <argument> or <classpath> Can be overridden using
"exec.args" env. |
private File |
basedir
|
static String |
CLASSPATH_TOKEN
|
private Map |
environmentVariables
Environment variables to pass to the executed program. |
private String |
executable
The executable. |
private boolean |
longClasspath
If set to true the classpath and the main class will be written to a MANIFEST.MF file and wrapped into a jar. |
private File |
outputFile
Program standard and error output will be redirected to the file specified by this optional field. |
private org.apache.maven.execution.MavenSession |
session
The current build session instance. |
private List |
successCodes
Exit codes to be resolved as successful execution for non-compliant applications (applications not returning 0 for success). |
private File |
workingDirectory
The current working directory. |
Fields inherited from class org.codehaus.mojo.exec.AbstractExecMojo |
---|
classpathScope, project |
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
ExecMojo()
|
Method Summary | |
---|---|
private static void |
addToClasspath(StringBuffer theClasspath,
String toAdd)
|
private List |
computeClasspath(Classpath specifiedClasspath)
Compute the classpath from the specified Classpath. |
private String |
computeClasspathString(Classpath specifiedClasspath)
Compute the classpath from the specified Classpath. |
private File |
createJar(List classPath,
String mainClass)
Create a jar with just a manifest containing a Main-Class entry for SurefireBooter and a Class-Path entry for all classpath elements. |
void |
execute()
priority in the execute method will be to use System properties arguments over the pom specification. |
protected int |
executeCommandLine(org.apache.commons.exec.Executor exec,
org.apache.commons.exec.CommandLine commandLine,
Map enviro,
OutputStream out,
OutputStream err)
|
private List |
filterArtifacts(List artifacts,
Collection dependencies)
|
private org.apache.maven.plugin.logging.Log |
getExecOutputLog()
|
(package private) String |
getExecutable()
|
(package private) org.apache.commons.exec.CommandLine |
getExecutablePath(Map enviro,
File dir)
|
protected org.apache.commons.exec.Executor |
getExecutor()
|
List |
getSuccessCodes()
|
protected String |
getSystemProperty(String key)
|
private org.apache.maven.toolchain.Toolchain |
getToolchain()
|
private static boolean |
isEmpty(String string)
|
private boolean |
isLongClassPathArgument(String arg)
|
(package private) boolean |
isResultCodeAFailure(int result)
|
(package private) void |
setArguments(List arguments)
|
(package private) void |
setBasedir(File basedir)
|
(package private) void |
setExecutable(String executable)
|
(package private) void |
setProject(org.apache.maven.project.MavenProject project)
|
void |
setSuccessCodes(List list)
|
(package private) void |
setWorkingDirectory(File workingDir)
|
(package private) void |
setWorkingDirectory(String workingDir)
|
Methods inherited from class org.codehaus.mojo.exec.AbstractExecMojo |
---|
collectProjectArtifactsAndClasspath, hasCommandlineArgs, isSkip, parseCommandlineArgs, registerSourceRoots |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
---|
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String executable
private File workingDirectory
private File outputFile
private List arguments
<argument>
or <classpath>
Can be overridden using
"exec.args" env. variable
private File basedir
private Map environmentVariables
private org.apache.maven.execution.MavenSession session
private List successCodes
private boolean longClasspath
public static final String CLASSPATH_TOKEN
Constructor Detail |
---|
public ExecMojo()
Method Detail |
---|
public void execute() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- if a failure happensprotected org.apache.commons.exec.Executor getExecutor()
boolean isResultCodeAFailure(int result)
private boolean isLongClassPathArgument(String arg)
private org.apache.maven.plugin.logging.Log getExecOutputLog()
private String computeClasspathString(Classpath specifiedClasspath)
specifiedClasspath
- Non null when the user restricted the dependenceis, null otherwise (the default classpath will be
used)
private List computeClasspath(Classpath specifiedClasspath)
specifiedClasspath
- Non null when the user restricted the dependenceis, null otherwise (the default classpath will be
used)
private static void addToClasspath(StringBuffer theClasspath, String toAdd)
private List filterArtifacts(List artifacts, Collection dependencies)
org.apache.commons.exec.CommandLine getExecutablePath(Map enviro, File dir)
private static boolean isEmpty(String string)
protected int executeCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, Map enviro, OutputStream out, OutputStream err) throws IOException
IOException
void setExecutable(String executable)
String getExecutable()
void setWorkingDirectory(String workingDir)
void setWorkingDirectory(File workingDir)
void setArguments(List arguments)
void setBasedir(File basedir)
void setProject(org.apache.maven.project.MavenProject project)
protected String getSystemProperty(String key)
public void setSuccessCodes(List list)
public List getSuccessCodes()
private org.apache.maven.toolchain.Toolchain getToolchain()
private File createJar(List classPath, String mainClass) throws IOException
classPath
- List<String> of all classpath elements.
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |