Package org.codehaus.plexus.util.cli

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


    unArchive.setSourceFile(bundle);
    unArchive.setDestDirectory(bundle.getParentFile());
    unArchive.extract();

    final StringBuilder sb = new StringBuilder();
    StreamConsumer out = new StreamConsumer()
    {
      public void consumeLine(String line) {
        sb.append(line).append('\n');
      }
    };
View Full Code Here


    unArchive.setSourceFile(bundle);
    unArchive.setDestDirectory(bundle.getParentFile());
    unArchive.extract();

    final StringBuilder sb = new StringBuilder();
    StreamConsumer out = new StreamConsumer()
    {
      public void consumeLine(String line) {
        sb.append(line).append('\n');
      }
    };
View Full Code Here

    unArchive.setSourceFile(bundle);
    unArchive.setDestDirectory(bundle.getParentFile());
    unArchive.extract();

    final StringBuilder sb = new StringBuilder();
    StreamConsumer out = new StreamConsumer()
    {
      public void consumeLine(String line) {
        sb.append(line).append('\n');
      }
    };
View Full Code Here

        cmdLine.createArg().setValue(className);
        for (String arg: args) {
            cmdLine.createArg().setValue(arg);
        }

        StreamConsumer infoStreamConsumer = new StreamConsumer() {
            @Override
            public void consumeLine(String line)
            {
                getLog().info(line);
            }
        };
        StreamConsumer errorStreamConsumer = new StreamConsumer() {
            @Override
            public void consumeLine(String line)
            {
                getLog().error(line);
            }
View Full Code Here

        if ( ! StringUtils.isEmpty( this.profiles ) )
        {
            cl.createArg().setValue( "-P" + this.profiles );
        }

        StreamConsumer consumer = new DefaultConsumer();

        try
        {
            int result = CommandLineUtils.executeCommandLine( cl, consumer, consumer );
View Full Code Here

        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

            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

        //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

        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

                                .arg( typeName )
                                .arg( "-css" )
                                .arg( candidate.getAbsolutePath() )
                                .addToClasspath( getGwtDevJar() )
                                .addToClasspath( getGwtUserJar() )
                                .setOut( new StreamConsumer()
                                    {
                                        public void consumeLine( String line )
                                        {
                                            content.append( line ).append( SystemUtils.LINE_SEPARATOR );
                                        }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.cli.StreamConsumer

Copyright © 2018 www.massapicom. 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.