Examples of ScmException


Examples of org.apache.maven.scm.ScmException

            logger.debug( "Synergy : Entering start method" );
        }

        if ( username == null )
        {
            throw new ScmException( "username can't be null" );
        }

        if ( password == null )
        {
            throw new ScmException( "password can't be null" );
        }

        Commandline cl = SynergyCCM.start( username, password, role );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
View Full Code Here

Examples of org.apache.maven.scm.ScmException

            }
            exitCode = CommandLineUtils.executeCommandLine( cl, stdout, stderr );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing synergy command [" + cl.toString() + "].", ex );
        }

        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Exit code :" + exitCode );
        }
        if ( stdout instanceof StringStreamConsumer )
        {
            if ( logger.isDebugEnabled() )
            {
                logger.debug( "STDOUT :" + ( (StringStreamConsumer) stdout ).getOutput() );
            }
        }
        else
        {
            if ( logger.isDebugEnabled() )
            {
                logger.debug( "STDOUT : unavailable" );
            }
        }
        if ( logger.isDebugEnabled() )
        {
            logger.debug( "STDERR :" + stderr.getOutput() );
        }

        if ( exitCode != 0 && failOnError )
        {
            if ( stdout instanceof StringStreamConsumer )
            {
                throw new ScmException( "Commandeline = " + cl.toString() + "\nSTDOUT = "
                    + ( (StringStreamConsumer) stdout ).getOutput() + "\nSTDERR = " + stderr.getOutput() + "\n" );
            }
            else
            {
                throw new ScmException( "Commandeline = " + cl.toString() + "\nSTDOUT = unavailable" + "\nSTDERR = "
                    + stderr.getOutput() + "\n" );
            }
        }

        return exitCode;
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        {
            exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing command.", ex );
        }
        finally
        {
            try
            {
View Full Code Here

Examples of org.apache.maven.scm.ScmException

                                                        ScmVersion version, boolean recursive )
        throws ScmException
    {
        if ( fileSet.getFileList().size() != 0 )
        {
            throw new ScmException( "This provider doesn't support checking out subsets of a project" );
        }

        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( "executing checkout command..." );
        }

        SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository;

        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( fileSet.toString() );
        }

        String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null );

        File waPath;
        try
        {
            String projectSpec =
                SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr );
            if ( projectSpec != null )
            {
                if ( getLogger().isInfoEnabled() )
                {
                    getLogger().info( "A working project already exists [" + projectSpec + "]." );
                }
                SynergyUtil.synchronize( getLogger(), projectSpec, ccmAddr );
            }
            else
            {
                SynergyUtil.checkoutProject( getLogger(), null, repo.getProjectSpec(), version,
                                             repo.getProjectPurpose(), repo.getProjectRelease(), ccmAddr );
                projectSpec =
                    SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr );
                if ( getLogger().isInfoEnabled() )
                {
                    getLogger().info( "A new working project [" + projectSpec + "] was created." );
                }
            }
            SynergyUtil.reconfigure( getLogger(), projectSpec, ccmAddr );
            waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr );

        }
        finally
        {
            SynergyUtil.stop( getLogger(), ccmAddr );
        }

        File source = new File( waPath, repo.getProjectName() );

        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info(
                              "We will now copy files from Synergy Work Area [" + source
                                  + "] to expected folder [" + fileSet.getBasedir() + "]" );
        }

        // Move files to the expected folder
        try
        {
            FileUtils.copyDirectoryStructure( source, fileSet.getBasedir() );
        }
        catch ( IOException e1 )
        {
            throw new ScmException( "Unable to copy directory structure", e1 );
        }

        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( "We will list content of checkout directory." );
        }

        // We need to list files in the directory
        List<ScmFile> files = new ArrayList<ScmFile>();
        try
        {
            @SuppressWarnings( "unchecked" )
            List<File> realFiles = FileUtils.getFiles( fileSet.getBasedir(), null, "_ccmwaid.inf" );
            for ( File f : realFiles )
            {
                files.add( new ScmFile( f.getPath(), ScmFileStatus.CHECKED_OUT ) );
            }
        }
        catch ( IOException e )
        {
            throw new ScmException( "Unable to list files in checkout directory", e );
        }

        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( "checkout command end successfully ..." );
View Full Code Here

Examples of org.apache.maven.scm.ScmException

            }
            exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing cvs command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new ChangeLogScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
View Full Code Here

Examples of org.apache.maven.scm.ScmException

            tagsInfos = consumer.infos;

        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing svn command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new RemoteInfoScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
        }

        cl = SvnCommandLineUtils.getBaseSvnCommandLine( fileSet == null ? null : fileSet.getBasedir(),
                                                        (SvnScmProviderRepository) repository );

        cl.createArg().setValue( "ls" );

        cl.createArg().setValue( baseUrl + "/tags" );

        stderr = new CommandLineUtils.StringStreamConsumer();

        consumer = new LsConsumer( getLogger(), baseUrl );

        Map<String, String> branchesInfos = null;

        try
        {
            exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() );
            branchesInfos = consumer.infos;

        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing svn command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new RemoteInfoScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        {
            exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing svn command.", ex );
        }

        if ( exitCode != 0 )
        {
            String output = stderr.getOutput();
            if ( output.indexOf( "W160013" ) >= 0 )
            {
                return false;
            }
            throw new ScmException( cl.toString() + ".The svn command failed:" + stderr.getOutput() );
        }

        return true;
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        {
            exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new CheckOutScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
View Full Code Here

Examples of org.apache.maven.scm.ScmException

    protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                                          ScmVersion startVersion, ScmVersion endVersion,
                                                          String datePattern )
        throws ScmException
    {
        throw new ScmException( "Unsupported method for this provider." );
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        }
        else
        {
            if ( numDays != 0 && ( startDate != null || endDate != null ) )
            {
                throw new ScmException( "Start or end date cannot be set if num days is set." );
            }

            if ( endDate != null && startDate == null )
            {
                throw new ScmException( "The end date is set but the start date isn't." );
            }

            if ( numDays > 0 )
            {
                int day = 24 * 60 * 60 * 1000;
 
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.