Package org.codehaus.plexus.util.cli

Examples of org.codehaus.plexus.util.cli.Commandline.addArguments()


    commandArgs.add(mainClass);
    commandArgs.add(buildFile);
    for (String param : mainParams) {
      commandArgs.add(param);
    }
    commandLine.addArguments(commandArgs.toArray(new String[commandArgs.size()]));

    try {
      log.info("Executing " + commandLine.toString());
      int resultCode = CommandLineUtils.executeCommandLine(commandLine, new LogStream(), new LogStream());
      if (resultCode > 0) {
View Full Code Here


     * @throws CommandLineException
     */
    public int compile() throws CommandLineException {
        Commandline cl = new Commandline();
        cl.setExecutable(executable);
        cl.addArguments(buildProtocCommand().toArray(new String[]{}));
        return CommandLineUtils.executeCommandLine(cl, null, output, error);
    }

    /**
     * Creates the command line arguments.
View Full Code Here

                "-sourcepath", sourcePath(),

                "-classpath", classPath() };

        command.addArguments(arguments);

        executeCommand(command);

        return readXML(parametersPath);
    }
View Full Code Here

    static Commandline buildCmd( File workingDir, String[] cmdAndArgs )
        throws ScmException
    {
        Commandline cmd = new Commandline();
        cmd.setExecutable( HgCommandConstants.EXEC );
        cmd.addArguments( cmdAndArgs );
        if ( workingDir != null )
        {
            cmd.setWorkingDirectory( workingDir.getAbsolutePath() );

            if ( !workingDir.exists() )
View Full Code Here

                "-classpath", classPath()};

        String argumentsFile = writeArgumentsFile(arguments);

        command.addArguments(new String[] {"@" + argumentsFile});

        executeCommand(command);

        return readXML(parametersPath);
    }
View Full Code Here

        Commandline commandline = new Commandline();

        String executable = javaHome + File.separator + "bin" + File.separator + "java";

        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 )
View Full Code Here

                commandline.addEnvironment( key, value );
            }

            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 )
View Full Code Here

            cmd.createArg().setValue(tmpFilePath);

        } catch (Exception e1) {
            throw new MojoExecutionException("Could not create runtime jar", e1);
        }
        cmd.addArguments(args);

        StreamConsumer out = new StreamConsumer() {
            public void consumeLine(String line) {
                getLog().info(line);
            }
View Full Code Here

            } catch (IOException e) {
                getLog().debug(e);
                throw new MojoExecutionException(e.getMessage(), e);
            }

            cmd.addArguments(args.toArray(new String[args.size()]));

            CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
            CommandLineUtils.StringStreamConsumer out = new CommandLineUtils.StringStreamConsumer();

            int exitCode;
View Full Code Here

        "-sourcepath", sourcePath(),

        "-classpath", classPath() };

        command.addArguments(arguments);

        executeCommand(command);

        return readXML(parametersPath);
    }
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.