Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmException


                {
                    getLog().error( message );
                }
            }

            throw new ScmException( "Can't load the scm provider.", e );
        }
        catch ( Exception e )
        {
            throw new ScmException( "Can't load the scm provider.", e );
        }

        return repository;
    }
View Full Code Here


            return new CheckInScmResult( "JGit checkin", checkedInFiles );
        }
        catch ( Exception e )
        {
            throw new ScmException( "JGit checkin failure!", e );
        }
        finally
        {
            JGitUtils.closeRepo( git );
        }
View Full Code Here

                svnRepo.setTagBase( tagBase );
            }
        }
        catch ( Exception e )
        {
            throw new ScmException( "Can't load the scm provider.", e );
        }

        return repository;
    }
View Full Code Here

        throws ScmException
    {
        getLogger().info( "Attempting to display scm file information for file: " + filename );
        if ( null == filename || filename.length() == 0 )
        {
            throw new ScmException( "A single filename is required to execute the fileinfo command!" );
        }
        ScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        APISession api = iRepo.getAPISession();
        Commandline shell = new Commandline();
View Full Code Here

        throws ScmException
    {
        getLogger().info( "Attempting to unlock file: " + filename );
        if ( null == filename || filename.length() == 0 )
        {
            throw new ScmException( "A single filename is required to execute the unlock command!" );
        }

        ScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
View Full Code Here

        {
            dirPath = fit.next().getPath().replace( '\\', '/' );
        }
        if ( null == dirPath || dirPath.length() == 0 )
        {
            throw new ScmException( "A relative directory path is required to execute this command!" );
        }
        getLogger().info( "Creating subprojects one per directory, as required for " + dirPath );
        MkdirScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
View Full Code Here

        throws ScmException
    {
        // First lets validate the date range provided
        if ( null == startDate || null == endDate )
        {
            throw new ScmException( "Both 'startDate' and 'endDate' must be specified!" );
        }
        if ( startDate.after( endDate ) )
        {
            throw new ScmException( "'stateDate' is not allowed to occur after 'endDate'!" );
        }
        getLogger().info(
            "Attempting to obtain change log for date range: '" + Sandbox.RLOG_DATEFORMAT.format( startDate ) + "' to '"
                + Sandbox.RLOG_DATEFORMAT.format( endDate ) + "'" );
        ChangeLogScmResult result;
View Full Code Here

        throws ScmException
    {
        getLogger().info( "Attempting to display blame results for file: " + filename );
        if ( null == filename || filename.length() == 0 )
        {
            throw new ScmException( "A single filename is required to execute the blame command!" );
        }
        BlameScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        APISession api = iRepo.getAPISession();
        // Since the si annotate command is not completely API ready, we will use the CLI for this command
View Full Code Here

        throws ScmException
    {

        if ( StringUtils.isBlank( branch ) )
        {
            throw new ScmException( "branch must be specified" );
        }

        if ( !fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "This provider doesn't support branchging subsets of a directory" );
        }

        File workingDir = fileSet.getBasedir();

        // build the command
        String[] branchCmd =
            new String[]{ HgCommandConstants.BRANCH_CMD, branch };

        // keep the command about in string form for reporting
        ;
        HgConsumer branchConsumer = new HgConsumer( getLogger() ) {
            public void doConsume( ScmFileStatus status, String trimmedLine )
            {
            }
        };

        ScmResult result = HgUtils.execute( branchConsumer, getLogger(), workingDir, branchCmd );
        HgScmProviderRepository repository = (HgScmProviderRepository) scmProviderRepository;

        if ( !result.isSuccess() )
        {
            throw new ScmException( "Error while executing command " + joinCmd( branchCmd ) );
        }

        // First commit.
        String[] commitCmd = new String[]{ HgCommandConstants.COMMIT_CMD, HgCommandConstants.MESSAGE_OPTION, scmBranchParameters.getMessage() };


        result = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), workingDir, commitCmd );

        if ( !result.isSuccess() )
        {
            throw new ScmException( "Error while executing command " + joinCmd( commitCmd ) );
        }

        // now push, if we should.

        if ( repository.isPushChanges() )
        {
            if ( !repository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) )
            {

                String[] pushCmd = new String[] {
                    HgCommandConstants.PUSH_CMD,
                    HgCommandConstants.NEW_BRANCH_OPTION,
                    repository.getURI()
                };

                result = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), pushCmd );

                if ( !result.isSuccess() )
                {
                    throw new ScmException( "Error while executing command " + joinCmd( pushCmd ) );
                }
            }
        }

        // do an inventory to return the files branched (all of them)
        String[] listCmd = new String[]{ HgCommandConstants.INVENTORY_CMD };
        HgListConsumer listconsumer = new HgListConsumer( getLogger() );

        result = HgUtils.execute( listconsumer, getLogger(), fileSet.getBasedir(), listCmd );

        if ( !result.isSuccess() )
        {
            throw new ScmException( "Error while executing command " + joinCmd(listCmd) );
        }

        List<ScmFile> files = listconsumer.getFiles();
        List<ScmFile> fileList = new ArrayList<ScmFile>();
        for ( Iterator<ScmFile> i = files.iterator(); i.hasNext(); )
View Full Code Here

        throws ScmException
    {
        getLogger().info( "Attempting to lock file: " + filename );
        if ( null == filename || filename.length() == 0 )
        {
            throw new ScmException( "A single filename is required to execute the lock command!" );
        }

        ScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
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.