Class 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)
    • Constructor Summary

      Constructors 
      Constructor Description
      ExecMojo()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Map<java.lang.String,​java.lang.String> createEnvs​(java.io.File envScriptFile)  
      protected java.io.File createEnvWrapperFile​(java.io.File envScript)  
      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, java.util.Map<java.lang.String,​java.lang.String> enviro, java.io.FileOutputStream outputFile)  
      protected int executeCommandLine​(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, java.util.Map<java.lang.String,​java.lang.String> enviro, java.io.OutputStream out, java.io.OutputStream err)  
      protected int executeCommandLine​(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, java.util.Map<java.lang.String,​java.lang.String> enviro, org.apache.commons.exec.PumpStreamHandler psh)  
      protected org.apache.commons.exec.ProcessDestroyer getProcessDestroyer()  
      int[] getSuccessCodes()  
      protected java.lang.String getSystemProperty​(java.lang.String key)  
      void setSuccessCodes​(java.lang.Integer... list)  
      • 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
    • Constructor Detail

      • ExecMojo

        public ExecMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        priority 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,
                                         java.util.Map<java.lang.String,​java.lang.String> enviro,
                                         java.io.OutputStream out,
                                         java.io.OutputStream err)
                                  throws org.apache.commons.exec.ExecuteException,
                                         java.io.IOException
        Throws:
        org.apache.commons.exec.ExecuteException
        java.io.IOException
      • executeCommandLine

        protected int executeCommandLine​(org.apache.commons.exec.Executor exec,
                                         org.apache.commons.exec.CommandLine commandLine,
                                         java.util.Map<java.lang.String,​java.lang.String> enviro,
                                         java.io.FileOutputStream outputFile)
                                  throws org.apache.commons.exec.ExecuteException,
                                         java.io.IOException
        Throws:
        org.apache.commons.exec.ExecuteException
        java.io.IOException
      • executeCommandLine

        protected int executeCommandLine​(org.apache.commons.exec.Executor exec,
                                         org.apache.commons.exec.CommandLine commandLine,
                                         java.util.Map<java.lang.String,​java.lang.String> enviro,
                                         org.apache.commons.exec.PumpStreamHandler psh)
                                  throws org.apache.commons.exec.ExecuteException,
                                         java.io.IOException
        Throws:
        org.apache.commons.exec.ExecuteException
        java.io.IOException
      • getSystemProperty

        protected java.lang.String getSystemProperty​(java.lang.String key)
      • setSuccessCodes

        public void setSuccessCodes​(java.lang.Integer... list)
      • getSuccessCodes

        public int[] getSuccessCodes()
      • createEnvs

        protected java.util.Map<java.lang.String,​java.lang.String> createEnvs​(java.io.File envScriptFile)
                                                                             throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • createEnvWrapperFile

        protected java.io.File createEnvWrapperFile​(java.io.File envScript)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getProcessDestroyer

        protected org.apache.commons.exec.ProcessDestroyer getProcessDestroyer()