Package org.apache.maven.shared.utils.cli

Examples of org.apache.maven.shared.utils.cli.Commandline


    {
        // SUREFIRE-657
        File cpElement = getTempClasspathFile();
        ForkConfiguration forkConfiguration = getForkConfiguration( "abc\ndef", null );

        final Commandline commandLine =
            forkConfiguration.createCommandLine( Collections.singletonList( cpElement.getAbsolutePath() ), false, false,
                                                 null, 1 );
        assertTrue( commandLine.toString().contains( "abc def" ) );
    }
View Full Code Here


        catch ( IOException e )
        {
            throw new CommandLineConfigurationException( e.getMessage(), e );
        }

        Commandline cli = new Commandline();

        cli.setExecutable( jarSignerFile );

        cli.setWorkingDirectory( request.getWorkingDirectory() );

        if ( request.isVerbose() )
        {
            cli.createArg().setValue( "-verbose" );
        }

        String maxMemory = request.getMaxMemory();
        if ( StringUtils.isNotEmpty( maxMemory ) )
        {
            cli.createArg().setValue( "-J-Xmx" + maxMemory );
        }

        String[] arguments = request.getArguments();
        if ( arguments != null )
        {
            cli.addArguments( arguments );
        }

        if ( request instanceof JarSignerSignRequest )
        {
            build( (JarSignerSignRequest) request, cli );
View Full Code Here

                throw new JarSignerException( "Error finding jar signer executable. Reason: " + e.getMessage(), e );
            }
        }

        // creates the command line
        Commandline cli = createCommandLine( request );

        // execute it
        return executeCommandLine( cli, request );
    }
View Full Code Here

        catch ( IOException e )
        {
            throw new CommandLineConfigurationException( e.getMessage(), e );
        }

        Commandline cli = new Commandline();

        cli.setExecutable( jarSignerFile );

        cli.setWorkingDirectory( request.getWorkingDirectory() );

        if ( request.isVerbose() )
        {
            cli.createArg().setValue( "-verbose" );
        }

        String keystore = request.getKeystore();
        if ( !StringUtils.isEmpty( keystore ) )
        {
            cli.createArg().setValue( "-keystore" );
            cli.createArg().setValue( keystore );
        }

        if ( request.isProtectedAuthenticationPath() )
        {
            cli.createArg().setValue( "-protected" );
        }

        String maxMemory = request.getMaxMemory();
        if ( StringUtils.isNotEmpty( maxMemory ) )
        {
            cli.createArg().setValue( "-J-Xmx" + maxMemory );
        }

        String[] arguments = request.getArguments();
        if ( arguments != null )
        {
            cli.addArguments( arguments );
        }

        if ( request instanceof JarSignerSignRequest )
        {
            build( (JarSignerSignRequest) request, cli );
        }

        if ( request instanceof JarSignerVerifyRequest )
        {
            build( (JarSignerVerifyRequest) request, cli );
        }

        cli.createArg().setFile( request.getArchive() );

        String alias = request.getAlias();
        if ( !StringUtils.isEmpty( alias ) )
        {
            cli.createArg().setValue( alias );
        }

        return cli;
    }
View Full Code Here

        JarSignerCommandLineBuilder cliBuilder = new JarSignerCommandLineBuilder();
        cliBuilder.setLogger( getLogger() );
        cliBuilder.setJarSignerFile( javaToolFile );
        try
        {
            Commandline cli = cliBuilder.build( request );
            if ( request.isVerbose() )
            {
                getLogger().info( cli.toString() );
            }
            else
            {
                getLogger().debug( cli.toString() );
            }
            return cli;
        }
        catch ( CommandLineConfigurationException e )
        {
View Full Code Here

        throws IOException, SurefireBooterForkException
    {
        ForkConfiguration config = getForkConfiguration( null, "java" );
        File cpElement = getTempClasspathFile();

        Commandline cli =
            config.createCommandLine( Collections.singletonList( cpElement.getAbsolutePath() ), true, false, null, 1 );

        String line = StringUtils.join( cli.getCommandline(), " " );
        assertTrue( line.contains( "-jar" ) );
    }
View Full Code Here

    {
        // SUREFIRE-657
        File cpElement = getTempClasspathFile();
        ForkConfiguration forkConfiguration = getForkConfiguration( "abc\ndef", null );

        final Commandline commandLine =
            forkConfiguration.createCommandLine( Collections.singletonList( cpElement.getAbsolutePath() ), false, false,
                                                 null, 1 );
        assertTrue( commandLine.toString().contains( "abc def" ) );
    }
View Full Code Here

        throws IOException, SurefireBooterForkException
    {
        ForkConfiguration config = getForkConfiguration( null, "java" );
        File cpElement = getTempClasspathFile();

        Commandline cli =
            config.createCommandLine( Collections.singletonList( cpElement.getAbsolutePath() ), true, false, 1 );

        String line = StringUtils.join( cli.getCommandline(), " " );
        assertTrue( line.contains( "-jar" ) );
    }
View Full Code Here

    {
        // SUREFIRE-657
        File cpElement = getTempClasspathFile();
        ForkConfiguration forkConfiguration = getForkConfiguration( "abc\ndef", null );

        final Commandline commandLine =
            forkConfiguration.createCommandLine( Collections.singletonList( cpElement.getAbsolutePath() ), false, false,
                                                 1 );
        assertTrue( commandLine.toString().contains( "abc def" ) );
    }
View Full Code Here

                                             e );
            }
        }

        // creates the command line from the given request
        Commandline cli = createCommandLine( request, javaToolFile );

        // execute it
        JavaToolResult result = executeCommandLine( cli, request );

        // return result
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.utils.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.