Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmException


        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        if ( GitScmProviderRepository.PROTOCOL_FILE.equals( repository.getFetchInfo().getProtocol() )
            && repository.getFetchInfo().getPath().indexOf( fileSet.getBasedir().getPath() ) >= 0 )
        {
            throw new ScmException( "remote repository must not be the working directory" );
        }

        int exitCode;

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


        String branch = GitBranchCommand.getCurrentBranch( logger, repository, fileSet );
       
        if ( branch == null || branch.length() == 0 )
        {
            throw new ScmException( "Could not detect the current branch. Don't know where I should push to!" );
        }
       
        cl.createArg().setValue( repository.getPushUrl() );
       
        cl.createArg().setValue( branch + ":" + branch );
View Full Code Here

        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        if ( GitScmProviderRepository.PROTOCOL_FILE.equals( repository.getFetchInfo().getProtocol() )
            && repository.getFetchInfo().getPath().indexOf( fileSet.getBasedir().getPath() ) >= 0 )
        {
            throw new ScmException( "remote repository must not be the working directory" );
        }

        int exitCode;

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

        throws ScmException
    {

        if ( fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "You must provide at least one file/directory to remove" );
        }

        Commandline cl = createCommandLine( fileSet.getBasedir(), fileSet.getFileList() );

        GitRemoveConsumer consumer = new GitRemoveConsumer( getLogger() );
View Full Code Here

        ScmProvider scmProviderMock = mock( ScmProvider.class );
        when( scmProviderMock.branch( isA( ScmRepository.class ),
                                   isA( ScmFileSet.class ),
                                   isA( String.class ),
                                   isA( ScmBranchParameters.class ) ) ).thenThrow( new ScmException( "..." ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( scmProviderMock );

        // execute
View Full Code Here

        ScmProvider scmProviderMock = mock( ScmProvider.class );
        when( scmProviderMock.tag( isA( ScmRepository.class ),
                                   isA( ScmFileSet.class ),
                                   isA( String.class ),
                                   isA( ScmTagParameters.class ) ) ).thenThrow( new ScmException( "..." ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( scmProviderMock );

        // execute
View Full Code Here

                checkedInFiles.add( new ScmFile( path, ScmFileStatus.CHECKED_IN ) );
            }
        }
        catch ( IOException e )
        {
            throw new ScmException( "Error while checking in the files.", e );
        }

        return new CheckInScmResult( null, checkedInFiles );
    }
View Full Code Here

                taggedFiles.add( new ScmFile( path, ScmFileStatus.TAGGED ) );
            }
        }
        catch ( IOException e )
        {
            throw new ScmException( "Error while tagging the files.", e );
        }

        return new TagScmResult( null, taggedFiles );
    }
View Full Code Here

        releaseDescriptor.setScmSourceUrl( "scm-url" );
        File checkoutDirectory = getTestFile( "target/checkout-directory" );
        releaseDescriptor.setCheckoutDirectory( checkoutDirectory.getAbsolutePath() );

        ScmProvider scmProviderMock = mock( ScmProvider.class );
        when( scmProviderMock.checkOut( any( ScmRepository.class ), any( ScmFileSet.class ), any ( ScmTag.class ) ) ).thenThrow( new ScmException( "..." ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( scmProviderMock );

        // execute
View Full Code Here

                checkedOutFiles.add( new ScmFile( path, ScmFileStatus.CHECKED_OUT ) );
            }
        }
        catch ( IOException e )
        {
            throw new ScmException( "Error while checking out the files.", e );
        }

        return new CheckOutScmResult( null, checkedOutFiles );
    }
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.