Package org.apache.maven.shared.release

Examples of org.apache.maven.shared.release.ReleaseFailureException


    protected void validateConfiguration( ReleaseDescriptor releaseDescriptor )
        throws ReleaseFailureException
    {
        if ( releaseDescriptor.getScmReleaseLabel() == null )
        {
            throw new ReleaseFailureException( "A release label is required for committing" );
        }
    }
View Full Code Here


                }
            }

            if ( StringUtils.isEmpty( releaseDescriptor.getScmSourceUrl() ) )
            {
                throw new ReleaseFailureException(
                    "Missing required setting: scm connection or developerConnection must be specified." );
            }

            // As long as Scm.getId() does not exist, read it as a property
            releaseDescriptor.setScmId( rootProject.getProperties().getProperty( "project.scm.id" ) );

            try
            {
                scmRepositoryConfigurator.getConfiguredRepository( releaseDescriptor, releaseEnvironment.getSettings() );
            }
            catch ( ScmRepositoryException e )
            {
                throw new ReleaseScmRepositoryException( e.getMessage(), e.getValidationMessages() );
            }
            catch ( NoSuchScmProviderException e )
            {
                throw new ReleaseFailureException(
                    "The provider given in the SCM URL could not be found: " + e.getMessage() );
            }
        }

        boolean containsSnapshotProjects = false;

        for ( MavenProject project : reactorProjects )
        {
            if ( ArtifactUtils.isSnapshot( project.getVersion() ) )
            {
                containsSnapshotProjects = true;
            }
        }

        if ( !containsSnapshotProjects && !releaseDescriptor.isBranchCreation() )
        {
            throw new ReleaseFailureException( "You don't have a SNAPSHOT project in the reactor projects list." );
        }

        result.setResultCode( ReleaseResult.SUCCESS );

        return result;
View Full Code Here

        File checkoutDirectory = getTestFile( "target/checkout" );
        releaseDescriptor.setCheckoutDirectory( checkoutDirectory.getAbsolutePath() );
        releaseDescriptor.setPerformGoals( "deploy site-deploy" );

        ReleaseManager mock = mock( ReleaseManager.class );
        ReleaseFailureException cause = new ReleaseFailureException( "..." );
        doThrow( cause ).when( mock ).perform( isA( ReleasePerformRequest.class ) );

        mojo.setReleaseManager( mock );

        // execute
View Full Code Here

        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
        releaseDescriptor.setWorkingDirectory( testFile.getParentFile().getAbsolutePath() );
        releaseDescriptor.setUpdateDependencies( false );
       
        ReleaseManager mock = mock( ReleaseManager.class );
        ReleaseFailureException cause = new ReleaseFailureException( "..." );
        doThrow( cause ).when( mock ).prepare( eq( releaseDescriptor ),
                                               isA( ReleaseEnvironment.class ),
                                               isNull( List.class),
                                               eq( true ),
                                               eq( false ) );
View Full Code Here

            new IsEqual( releaseDescriptor ),
            new IsInstanceOf( ReleaseEnvironment.class ),
            new IsNull()
        };

        ReleaseFailureException cause = new ReleaseFailureException( "..." );
        mock.expects( new InvokeOnceMatcher() ).method( "perform" ).with( constraints ).will(
            new ThrowStub( cause ) );
        mojo.setReleaseManager( (ReleaseManager) mock.proxy() );

        try
View Full Code Here

            new IsNull(),
            new IsEqual( Boolean.TRUE ),
            new IsEqual( Boolean.FALSE )
        };

        ReleaseFailureException cause = new ReleaseFailureException( "..." );
        mock.expects( new InvokeOnceMatcher() ).method( "prepare" ).with( constraints ).will(
            new ThrowStub( cause ) );
        mojo.setReleaseManager( (ReleaseManager) mock.proxy() );

        try
View Full Code Here

        {
            releaseModel.getBuild().setFinalName( null );
        }
        else if ( finalName.indexOf( "SNAPSHOT" ) != -1 )
        {
            throw new ReleaseFailureException( "Cannot reliably adjust the finalName of project: "
                            + releaseProject.getId() );
        }

        // update scm
        Scm scm = releaseModel.getScm();
View Full Code Here

        String nextVersion = (String) mappedVersions.get( id );

        if ( nextVersion == null )
        {
            throw new ReleaseFailureException( "Version for '" + id + "' was not mapped" );
        }

        return nextVersion;
    }
View Full Code Here

            {
                version = mappedVersion;
            }
            else
            {
                throw new ReleaseFailureException( "Version '" + version + "' for '" + key + "' was not mapped" );
            }
        }
        else
        {
            if ( !ArtifactUtils.isSnapshot( version ) )
View Full Code Here

    {
        Element versionElement = rootElement.getChild( "version", namespace );
        String version = (String) mappedVersions.get( projectId );
        if ( version == null )
        {
            throw new ReleaseFailureException( "Version for '" + project.getName() + "' was not mapped" );
        }

        if ( versionElement == null )
        {
            if ( !version.equals( parentVersion ) )
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.release.ReleaseFailureException

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.