Package org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli

Examples of org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli.Commandline


        if (useSystemClassLoader()) {
            bootClasspath.addAll(classPathUrls);
        }

        Commandline cli =
            forkConfiguration.createCommandLine(bootClasspath, useManifestOnlyJar());

        cli.createArg().setFile(surefireProperties);

        if (systemProperties != null) {
            cli.createArg().setFile(systemProperties);
        }

        ForkingStreamConsumer out = getForkingStreamConsumer(showHeading, showFooter, redirectTestOutputToFile);

        StreamConsumer err;
View Full Code Here


    public Commandline createCommandLine(List classPath) throws SurefireBooterForkException {
        return createCommandLine(classPath, false);
    }

    public Commandline createCommandLine(List classPath, boolean useJar) throws SurefireBooterForkException {
        Commandline cli = new Commandline();

        cli.setExecutable(jvmExecutable);

        if (argLine != null) {
            cli.createArg().setLine(argLine);
        }

        if (environmentVariables != null) {
            Iterator iter = environmentVariables.keySet().iterator();

            while (iter.hasNext()) {
                String key = (String)iter.next();

                String value = (String)environmentVariables.get(key);

                cli.addEnvironment(key, value);
            }
        }

        if (debugLine != null && !"".equals(debugLine)) {
            cli.createArg().setLine(debugLine);
        }

        if (useJar) {
            File jarFile;
            try {
                jarFile = createJar(classPath);
            } catch (IOException e) {
                throw new SurefireBooterForkException("Error creating archive file", e);
            }

            cli.createArg().setValue("-jar");

            cli.createArg().setValue(jarFile.getAbsolutePath());
        } else {
            cli.createArg().setValue("-classpath");

            cli.createArg().setValue(StringUtils.join(classPath.iterator(), File.pathSeparator));

            cli.createArg().setValue(OSGiSurefireBooter.class.getName());
        }

        cli.setWorkingDirectory(workingDirectory.getAbsolutePath());

        return cli;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli.Commandline

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.