Examples of StreamConsumer


Examples of org.codehaus.plexus.util.cli.StreamConsumer

        if ( !interactive )
        {
            cl.createArgument().setValue( "--batch-mode" );
        }

        StreamConsumer stdOut = new TeeConsumer( System.out );

        StreamConsumer stdErr = new TeeConsumer( System.err );

        try
        {
            relResult.appendInfo( "Executing: " + cl.toString() );
            log.info( "Executing: " + cl.toString() );

            int result = CommandLineUtils.executeCommandLine( cl, stdOut, stdErr );

            if ( result != 0 )
            {
                throw new MavenExecutorException( "Maven execution failed, exit code: \'" + result + "\'", result,
                                                  stdOut.toString(), stdErr.toString() );
            }
        }
        catch ( CommandLineException e )
        {
            throw new MavenExecutorException( "Can't run goal " + goals, stdOut.toString(), stdErr.toString(), e );
        }
        finally
        {
            relResult.appendOutput( stdOut.toString() );
        }
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

        //CommandLineUtils.StringStreamConsumer consumer = new CommandLineUtils.StringStreamConsumer();

        Writer writer = new FileWriter( output );

        StreamConsumer consumer = new WriterStreamConsumer( writer );

        int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, consumer );

        writer.flush();
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

        if ( !interactive )
        {
            cl.createArgument().setValue( "--batch-mode" );
        }

        StreamConsumer stdOut = new TeeConsumer( System.out );

        StreamConsumer stdErr = new TeeConsumer( System.err );

        try
        {
        relResult.appendInfo( "Executing: " + cl.toString() );
        log.info( "Executing: " + cl.toString() );

        int result = CommandLineUtils.executeCommandLine( cl, stdOut, stdErr );

        if ( result != 0 )
        {
            throw new MavenExecutorException( "Maven execution failed, exit code: \'" + result + "\'", result,
                                              stdOut.toString(), stdErr.toString() );
        }
        }
        catch ( CommandLineException e )
        {
            throw new MavenExecutorException( "Can't run goal " + goals, stdOut.toString(), stdErr.toString(), e );
        }
        finally
        {
            relResult.appendOutput( stdOut.toString() );
        }
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

        commandline.setExecutable( executable );
        commandline.addArguments( new String[]{"-version"} );
        final List<String> cliOutput = new ArrayList<String>();
        //TODO ShellCommandHelper ?
        int result = CommandLineUtils.executeCommandLine( commandline, new StreamConsumer()
        {
            public void consumeLine( String line )
            {
                cliOutput.add( line );
            }
        }, new StreamConsumer()
        {
            public void consumeLine( String line )
            {
                cliOutput.add( line );
            }
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

            executable = executable.append( executorConfigurator.getExecutable() );
            commandline.setExecutable( executable.toString() );
            commandline.addArguments( new String[]{executorConfigurator.getVersionArgument()} );
            final List<String> cliOutput = new ArrayList<String>();
            //TODO ShellCommandHelper ?
            int result = CommandLineUtils.executeCommandLine( commandline, new StreamConsumer()
            {
                public void consumeLine( String line )
                {
                    cliOutput.add( line );
                }
            }, new StreamConsumer()
            {
                public void consumeLine( String line )
                {
                    cliOutput.add( line );
                }
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

    cli.setExecutable(getExecutablePath());
    cli.createArg().setValue(config.getAbsolutePath());

    try {
      Writer stringWriter = new StringWriter();
      StreamConsumer out = new WriterStreamConsumer(stringWriter);
      StreamConsumer err = new WriterStreamConsumer(stringWriter);

      int returnCode = CommandLineUtils.executeCommandLine(cli, out, err);

      getLog().debug("Doxygen output:");
      getLog().debug(stringWriter.toString());
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

        cli.setWorkingDirectory(basedir.getAbsolutePath());
        cli.setExecutable(executable.getAbsolutePath());
        cli.addArguments(buildCommandArguments());

        Writer stringWriter = new StringWriter();
        StreamConsumer out = new WriterStreamConsumer(stringWriter);
        StreamConsumer err = new WriterStreamConsumer(stringWriter);

        try {
            int returnCode = CommandLineUtils.executeCommandLine(cli, out, err);

            getLog().info("NDoc output:");
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

    commandline.createArg().setValue("-Dmonitor.key=" + monitorKey);
    commandline.createArg().setValue("-Dappengine.sdk.root=" + System.getProperty("appengine.sdk.root"));
    commandline.createArg().setValue(AppEnginePluginMonitor.class.getName());
    commandline.addArguments(args.toArray(new String[args.size()]));

    final StreamConsumer outConsumer = new StreamConsumer() {
      public void consumeLine(final String line) {
        consumeOutputLine(line);
      }
    };

    final StreamConsumer errConsumer = new StreamConsumer() {
      public void consumeLine(final String line) {
        consumeErrorLine(line);
      }
    };
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

    commandline.createArg().setValue("-Dmonitor.key=" + monitorKey);
    commandline.createArg().setValue("-Dappengine.sdk.root=" + System.getProperty("appengine.sdk.root"));
    commandline.createArg().setValue(AppEnginePluginMonitor.class.getName());
    commandline.addArguments(args.toArray(new String[args.size()]));

    final StreamConsumer outConsumer = new StreamConsumer() {
      public void consumeLine(final String line) {
        consumeOutputLine(line);
      }
    };

    final StreamConsumer errConsumer = new StreamConsumer() {
      public void consumeLine(final String line) {
        consumeErrorLine(line);
      }
    };
View Full Code Here

Examples of org.codehaus.plexus.util.cli.StreamConsumer

    commandline.createArg().setValue("-Dmonitor.key=" + monitorKey);
    commandline.createArg().setValue("-Dappengine.sdk.root=" + System.getProperty("appengine.sdk.root"));
    commandline.createArg().setValue(AppEnginePluginMonitor.class.getName());
    commandline.addArguments(args.toArray(new String[args.size()]));

    final StreamConsumer outConsumer = new StreamConsumer() {
      public void consumeLine(final String line) {
        consumeOutputLine(line);
      }
    };

    final StreamConsumer errConsumer = new StreamConsumer() {
      public void consumeLine(final String line) {
        consumeErrorLine(line);
      }
    };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.