Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmException


            {
                copyDirectoryStructure( source, fileSet.getBasedir(), modifications );
            }
            catch ( IOException e1 )
            {
                throw new ScmException( "Unable to copy directory structure", e1 );
            }
        }

        return new UpdateScmResult( "ccm reconcile -uwa ...", modifications );
    }
View Full Code Here


        {
            String projectSpec =
                SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr );
            if ( projectSpec == null )
            {
                throw new ScmException( "You should checkout a working project first" );
            }
            List<SynergyTask> tasks = SynergyUtil.getCompletedTasks( getLogger(), projectSpec, startDate, endDate, ccmAddr );
            for ( SynergyTask t : tasks )
            {
                ChangeSet cs = new ChangeSet();
View Full Code Here

                SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr );
            File waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr );
            File sourcePath = new File( waPath, repo.getProjectName() );
            if ( projectSpec == null )
            {
                throw new ScmException( "You should checkout project first" );
            }
            int taskNum = SynergyUtil.createTask( getLogger(), "Maven SCM Synergy provider: edit command for project "
                + repo.getProjectSpec(), repo.getProjectRelease(), true, ccmAddr );
            if ( getLogger().isInfoEnabled() )
            {
                getLogger().info( "Task " + taskNum + " was created to perform checkout." );
            }
            for ( File f : fileSet.getFileList() )
            {
                File dest = f;
                File source = new File( sourcePath, SynergyUtil.removePrefix( fileSet.getBasedir(), f ) );
                List<File> list = new LinkedList<File>();
                list.add( source );
                SynergyUtil.checkoutFiles( getLogger(), list, ccmAddr );
                if ( !source.equals( dest ) )
                {
                    if ( getLogger().isDebugEnabled() )
                    {
                        getLogger().debug( "Copy file [" + source + "] to expected folder [" + dest + "]." );
                    }
                    try
                    {
                        FileUtils.copyFile( source, dest );
                    }
                    catch ( IOException e )
                    {
                        throw new ScmException( "Unable to copy file from Work Area", e );
                    }
                }
            }
        }
        finally
View Full Code Here

            {
                cl.createArg().setValue( f.getCanonicalPath() );
            }
            catch ( IOException e )
            {
                throw new ScmException( "Invalid file path " + f.toString(), e );
            }
        }

        return cl;
View Full Code Here

            {
                cl.createArg().setValue( f.getCanonicalPath() );
            }
            catch ( IOException e )
            {
                throw new ScmException( "Invalid file path " + f.toString(), e );
            }
        }

        return cl;
View Full Code Here

    public final void execute()
        throws ScmException, IOException
    {
        if ( cvsRoot == null )
        {
            throw new ScmException( "cvsroot is required" );
        }

        if ( logger.isDebugEnabled() )
        {
            logger.debug( "cvsRoot: " + cvsRoot );
            logger.debug( "passFile: " + passFile );
        }

        BufferedReader reader = null;

        PrintWriter writer = null;
        try
        {
            StringBuilder buf = new StringBuilder();

            if ( passFile.exists() )
            {
                reader = new BufferedReader( new FileReader( passFile ) );

                String line = null;

                while ( ( line = reader.readLine() ) != null )
                {
                    if ( !line.startsWith( cvsRoot ) && !line.startsWith( "/1 " + cvsRoot ) )
                    {
                        buf.append( line ).append( "\n" );
                    }
                    else
                    {
                        if ( logger.isDebugEnabled() )
                        {
                            logger.debug( "cvsroot " + cvsRoot + " already exist in " + passFile.getAbsolutePath()
                                + ". SKIPPED." );
                        }

                        return;
                    }
                }
            }
            else
            {
                passFile.getParentFile().mkdirs();
            }

            if ( password == null )
            {
                throw new ScmException( "password is required. You must run a 'cvs -d " + cvsRoot
                    + " login' first or provide it in the connection url." );
            }

            //logger.debug( "password: " + password );
View Full Code Here

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

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

    public GitScmProviderRepository( String url )
        throws ScmException
    {
        if ( url == null )
        {
            throw new ScmException( "url must not be null" );
        }

        if ( url.startsWith( URL_DELIMITER_FETCH ) )
        {
            String fetch = url.substring( URL_DELIMITER_FETCH.length() );
View Full Code Here

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

        return exitCode;
    }
View Full Code Here

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

        return exitCode;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.ScmException

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.