Tabnine Logo
CommandLineUtils.executeCommandLine
Code IndexAdd Tabnine to your IDE (free)

How to use
executeCommandLine
method
in
org.apache.maven.shared.utils.cli.CommandLineUtils

Best Java code snippets using org.apache.maven.shared.utils.cli.CommandLineUtils.executeCommandLine (Showing top 9 results out of 315)

origin: org.apache.maven.shared/maven-shared-utils

/**
 * @param cl The command line {@link Commandline}
 * @param systemOut {@link StreamConsumer}
 * @param systemErr {@link StreamConsumer}
 * @return return code.
 * @throws CommandLineException in case of a problem.
 */
public static int executeCommandLine( @Nonnull Commandline cl, StreamConsumer systemOut, StreamConsumer systemErr )
  throws CommandLineException
{
  return executeCommandLine( cl, null, systemOut, systemErr, 0 );
}
origin: com.mulesoft.munit/munit-maven-plugins-common

public int execute(StreamConsumer outStreamConsumer, StreamConsumer errStreamConsumer) throws CommandLineException {
 log.debug("Executing command line: " + commandline);
 return CommandLineUtils.executeCommandLine(commandline, outStreamConsumer, errStreamConsumer);
}
origin: org.apache.maven.shared/maven-shared-utils

/**
 * @param cl               The command line to execute
 * @param systemIn         The input to read from, must be thread safe
 * @param systemOut        A consumer that receives output, must be thread safe
 * @param systemErr        A consumer that receives system error stream output, must be thread safe
 * @param timeoutInSeconds Positive integer to specify timeout, zero and negative integers for no timeout.
 * @return A return value, see {@link Process#exitValue()}
 * @throws CommandLineException or CommandLineTimeOutException if time out occurs
 */
public static int executeCommandLine( @Nonnull Commandline cl, InputStream systemIn, StreamConsumer systemOut,
                   StreamConsumer systemErr, int timeoutInSeconds )
  throws CommandLineException
{
  return executeCommandLine( cl, systemIn, systemOut, systemErr, timeoutInSeconds, null );
}
origin: org.apache.maven.shared/maven-shared-utils

/**
 * @param cl The command line {@link Commandline}
 * @param systemOut {@link StreamConsumer}
 * @param systemErr {@link StreamConsumer}
 * @param timeoutInSeconds The timeout.
 * @return return code.
 * @throws CommandLineException in case of a problem.
 */
public static int executeCommandLine( @Nonnull Commandline cl, StreamConsumer systemOut, StreamConsumer systemErr,
                   int timeoutInSeconds )
  throws CommandLineException
{
  return executeCommandLine( cl, null, systemOut, systemErr, timeoutInSeconds );
}
origin: org.apache.maven.shared/maven-shared-utils

/**
 * @param cl The command line {@link Commandline}
 * @param systemIn {@link StreamConsumer}
 * @param systemOut {@link StreamConsumer}
 * @param systemErr {@link StreamConsumer}
 * @return return code.
 * @throws CommandLineException in case of a problem.
 */
public static int executeCommandLine( @Nonnull Commandline cl, InputStream systemIn, StreamConsumer systemOut,
                   StreamConsumer systemErr )
  throws CommandLineException
{
  return executeCommandLine( cl, systemIn, systemOut, systemErr, 0 );
}
origin: org.apache.maven.shared/maven-shared-utils

/**
 * @param cl               The command line to execute
 * @param systemIn         The input to read from, must be thread safe
 * @param systemOut        A consumer that receives output, must be thread safe
 * @param systemErr        A consumer that receives system error stream output, must be thread safe
 * @param timeoutInSeconds Positive integer to specify timeout, zero and negative integers for no timeout.
 * @param runAfterProcessTermination Optional callback to run after the process terminated or the the timeout was
 *  exceeded, but before waiting on the stream feeder and pumpers to finish.
 * @return A return value, see {@link Process#exitValue()}
 * @throws CommandLineException or CommandLineTimeOutException if time out occurs
 */
public static int executeCommandLine( @Nonnull Commandline cl, InputStream systemIn, StreamConsumer systemOut,
                   StreamConsumer systemErr, int timeoutInSeconds,
                   @Nullable Runnable runAfterProcessTermination )
  throws CommandLineException
{
  return executeCommandLine( cl, systemIn, systemOut, systemErr, timeoutInSeconds, runAfterProcessTermination,
                null );
}
origin: org.apache.maven.shared/maven-verifier

public static void launchSubversion( String line, String basedir )
  throws VerificationException
{
  try
  {
    Commandline cli = new Commandline( line );
    cli.setWorkingDirectory( basedir );
    Writer logWriter = new FileWriter( new File( basedir, LOG_FILENAME ) );
    StreamConsumer out = new WriterStreamConsumer( logWriter );
    StreamConsumer err = new WriterStreamConsumer( logWriter );
    System.out.println( "Command: " + CommandLineUtils.toString( cli.getCommandline() ) );
    int ret = CommandLineUtils.executeCommandLine( cli, out, err );
    logWriter.close();
    if ( ret > 0 )
    {
      System.err.println( "Exit code: " + ret );
      throw new VerificationException();
    }
  }
  catch ( CommandLineException e )
  {
    throw new VerificationException( e );
  }
  catch ( IOException e )
  {
    throw new VerificationException( e );
  }
}
origin: org.apache.maven.shared/maven-verifier

return CommandLineUtils.executeCommandLine( cmd, out, err );
origin: org.apache.maven.shared/maven-shared-utils

/**
 * @param cli {@link Commandline}
 * @param request The request.
 * @return {@link JavaToolRequest}
 */
protected JavaToolResult executeCommandLine( Commandline cli, Request request )
{
  if ( getLogger().isDebugEnabled() )
  {
    getLogger().debug( "Executing: " + cli );
  }
  JavaToolResult result = createResult();
  result.setCommandline( cli );
  InputStream systemIn = createSystemInputStream();
  StreamConsumer systemOut = createSystemOutStreamConsumer( request );
  StreamConsumer systemErr = createSystemErrorStreamConsumer( request );
  try
  {
    int resultCode = CommandLineUtils.executeCommandLine( cli, systemIn, systemOut, systemErr );
    result.setExitCode( resultCode );
  }
  catch ( CommandLineException e )
  {
    result.setExecutionException( e );
  }
  return result;
}
org.apache.maven.shared.utils.cliCommandLineUtilsexecuteCommandLine

Popular methods of CommandLineUtils

  • getSystemEnvVars
    Return the shell environment variables. If caseSensitive == true, then envar keys will all be upper-
  • translateCommandline
  • ensureCaseSensitivity
  • executeCommandLineAsCallable
  • toString

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now