Package org.codehaus.mojo.exec
Class ExecMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.exec.AbstractExecMojo
org.codehaus.mojo.exec.ExecMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="exec",
threadSafe=true,
requiresDependencyResolution=TEST)
public class ExecMojo
extends AbstractExecMojo
A Plugin for executing external programs.
- Since:
- 1.0
- Version:
- $Id$
- Author:
- Jerome Lacoste (jerome@coffeebreaks.org)
-
Field Summary
FieldsFields inherited from class org.codehaus.mojo.exec.AbstractExecMojo
classpathScope, executableDependency, includePluginDependencies, project, repositorySystemFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExecMojo(org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.toolchain.ToolchainManager toolchainManager) -
Method Summary
Modifier and TypeMethodDescriptioncreateEnvs(File envScriptFile) protected FilecreateEnvWrapperFile(File envScript) voidexecute()priority in the execute method will be to use System properties arguments over the pom specification.protected intexecuteCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, Map<String, String> enviro, FileOutputStream outputFile) protected intexecuteCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, Map<String, String> enviro, OutputStream out, OutputStream err) protected intexecuteCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, Map<String, String> enviro, org.apache.commons.exec.PumpStreamHandler psh) protected org.apache.commons.exec.ProcessDestroyerint[]protected StringgetSystemProperty(String key) voidsetSuccessCodes(Integer... list) Methods inherited from class org.codehaus.mojo.exec.AbstractExecMojo
collectProjectArtifactsAndClasspath, determineRelevantPluginDependencies, findExecutableArtifact, getPluginDependencies, getSession, hasCommandlineArgs, isSkip, parseCommandlineArgs, registerSourceRootsMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
CLASSPATH_TOKEN
- See Also:
-
MODULEPATH_TOKEN
- See Also:
-
-
Constructor Details
-
ExecMojo
@Inject protected ExecMojo(org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.toolchain.ToolchainManager toolchainManager)
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionpriority in the execute method will be to use System properties arguments over the pom specification.- Throws:
org.apache.maven.plugin.MojoExecutionException- if a failure happens
-
executeCommandLine
protected int executeCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, Map<String, String> enviro, OutputStream out, OutputStream err) throws IOException- Throws:
IOException
-
executeCommandLine
protected int executeCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, Map<String, String> enviro, FileOutputStream outputFile) throws IOException- Throws:
IOException
-
executeCommandLine
protected int executeCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, Map<String, String> enviro, org.apache.commons.exec.PumpStreamHandler psh) throws IOException- Throws:
IOException
-
getSystemProperty
-
setSuccessCodes
-
getSuccessCodes
public int[] getSuccessCodes() -
createEnvs
protected Map<String,String> createEnvs(File envScriptFile) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
createEnvWrapperFile
- Throws:
IOException
-
getProcessDestroyer
protected org.apache.commons.exec.ProcessDestroyer getProcessDestroyer()
-