Package org.apache.maven.shared.release

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


                {
                    translateScm( project, releaseDescriptor, scmRoot, namespace, scmRepository, result, commonBasedir );
                }
                catch ( IOException e )
                {
                    throw new ReleaseExecutionException( e.getMessage(), e );
                }
            }
            else
            {
                releaseDescriptor.mapOriginalScmInfo( projectId, null );

                MavenProject parent = project.getParent();
                if ( parent != null )
                {
                    // If the SCM element is not present, only add it if the parent was not mapped (ie, it's external to
                    // the release process and so has not been modified, so the values will not be correct on the tag),
                    String parentId = ArtifactUtils.versionlessKey( parent.getGroupId(), parent.getArtifactId() );
                    if ( !releaseDescriptor.getOriginalScmInfo().containsKey( parentId ) )
                    {
                        // we need to add it, since it has changed from the inherited value
                        scmRoot = new Element( "scm" );
                        scmRoot.addContent( "\n  " );

                        try
                        {
                            if ( translateScm( project, releaseDescriptor, scmRoot, namespace, scmRepository, result,
                                               commonBasedir ) )
                            {
                                rootElement.addContent( "\n  " ).addContent( scmRoot ).addContent( "\n" );
                            }
                        }
                        catch ( IOException e )
                        {
                            throw new ReleaseExecutionException( e.getMessage(), e );
                        }
                    }
                }
            }
        }
View Full Code Here


        {
            throw new ReleaseScmRepositoryException( e.getMessage(), e.getValidationMessages() );
        }
        catch ( NoSuchScmProviderException e )
        {
            throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
        }

        if ( releaseDescriptor.isCommitByProject() )
        {
            for ( Iterator<MavenProject> i = reactorProjects.iterator(); i.hasNext(); )
View Full Code Here

        {
            result = provider.checkIn( repository, fileSet, (ScmVersion) null, message );
        }
        catch ( ScmException e )
        {
            throw new ReleaseExecutionException( "An error is occurred in the checkin process: " + e.getMessage(), e );
        }

        if ( !result.isSuccess() )
        {
            throw new ReleaseScmCommandException( "Unable to commit files", result );
View Full Code Here

                MavenExecutor mavenExecutor = mavenExecutors.get( releaseEnvironment.getMavenExecutorId() );

                if ( mavenExecutor == null )
                {
                    throw new ReleaseExecutionException(
                        "Cannot find Maven executor with id: " + releaseEnvironment.getMavenExecutorId() );
                }

                mavenExecutor.executeGoals( determineWorkingDirectory( workingDirectory,
                                                                       releaseDescriptor.getScmRelativePathProjectDirectory() ),
                                            goals, releaseEnvironment, releaseDescriptor.isInteractive(),
                                            additionalArguments, result );
            }
        }
        catch ( MavenExecutorException e )
        {
            throw new ReleaseExecutionException( e.getMessage(), e );
        }

        result.setResultCode( ReleaseResult.SUCCESS );

        return result;
View Full Code Here

                        releaseVersionInfo = new DefaultVersionInfo( "1.0" );
                    }
                    catch ( VersionParseException e1 )
                    {
                        // if that happens we are in serious trouble!
                        throw new ReleaseExecutionException( "Version 1.0 could not be parsed!", e1 );
                    }
                }

                if ( nextSnapshotVersionInfo == null )
                {
                    nextSnapshotVersionInfo = releaseVersionInfo.getNextVersion();
                }
            }
            else
            {
                // cannot proceed without a next value in batch mode
                throw new ReleaseExecutionException( msg, e );
            }
        }

        try
        {
            if ( convertToSnapshot )
            {
                if ( releaseDescriptor.isBranchCreation() )
                {
                    if ( convertToBranch )
                    {
                        // branch modification
                        if ( releaseDescriptor.isUpdateBranchVersions()
                            && ( ArtifactUtils.isSnapshot( project.getVersion() ) || releaseDescriptor.isUpdateVersionsToSnapshot() ) )
                        {
                            nextVersion = releaseVersionInfo.getSnapshotVersionString();
                            if ( !releaseVersionIsExplicit && releaseDescriptor.isInteractive() )
                            {
                                nextVersion = prompter.prompt(
                                    "What is the branch version for \"" + project.getName() + "\"? (" + projectId + ")",
                                    nextVersion );
                            }
                        }
                        else
                        {
                            nextVersion = project.getVersion();
                        }

                    }
                    else
                    {
                        // working copy modification
                        if ( ArtifactUtils.isSnapshot( project.getVersion() )
                            && releaseDescriptor.isUpdateWorkingCopyVersions() )
                        {
                            nextVersion = nextSnapshotVersionInfo.getSnapshotVersionString();
                            if ( releaseDescriptor.isInteractive() && !nextSnapshotVersionIsExplicit )
                            {
                                nextVersion =
                                    prompter.prompt( "What is the new working copy version for \"" + project.getName()
                                        + "\"? (" + projectId + ")", nextVersion );
                            }
                        }
                        else
                        {
                            nextVersion = project.getVersion();
                        }
                    }
                }
                else
                {
                    nextVersion = nextSnapshotVersionInfo.getSnapshotVersionString();
                    if ( releaseDescriptor.isInteractive()  && !nextSnapshotVersionIsExplicit )
                    {
                        nextVersion =
                            prompter.prompt( "What is the new development version for \"" + project.getName() + "\"? ("
                                + projectId + ")", nextVersion );
                    }
                }
            }
            else
            {
                if ( ArtifactUtils.isSnapshot( project.getVersion() ) )
                {
                    nextVersion = releaseVersionInfo.getReleaseVersionString();

                    if ( releaseDescriptor.isInteractive() && !releaseVersionIsExplicit )
                    {
                        nextVersion = prompter.prompt(
                            "What is the release version for \"" + project.getName() + "\"? (" + projectId + ")",
                            nextVersion );
                    }
                }
                else
                {
                    nextVersion = project.getVersion();
                }
            }
        }
        catch ( PrompterException e )
        {
            throw new ReleaseExecutionException( "Error reading version from input handler: " + e.getMessage(), e );
        }

        return nextVersion;
    }
View Full Code Here

        {
            FileUtils.copyFile( ReleaseUtil.getStandardPom( project ), getPomBackup( project ) );
        }
        catch ( IOException e )
        {
            throw new ReleaseExecutionException( "Error creating backup POM: " + e.getMessage(), e );
        }
    }
View Full Code Here

        {
            reactorProjects.addAll( getReactorProjects( releaseDescriptor ) );
        }
        catch ( ContinuumReleaseException e )
        {
            throw new ReleaseExecutionException( "Unable to get reactor projects: " + e.getMessage(), e );
        }

        result.setResultCode( ReleaseResult.SUCCESS );

        return result;
View Full Code Here

            throw new ReleaseScmRepositoryException(
                e.getMessage() + " for URL: " + releaseDescriptor.getScmSourceUrl(), e.getValidationMessages() );
        }
        catch ( NoSuchScmProviderException e )
        {
            throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
        }

        UpdateScmResult updateScmResult = null;
        CheckOutScmResult checkOutScmResult = null;

        File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
        ScmFileSet workingDirSet = new ScmFileSet( workingDirectory );

        try
        {
            if ( !workingDirectory.exists() )
            {
                workingDirectory.mkdirs();
            }

            ScmVersion scmTag = null;

            ScmProviderRepository providerRepo = repository.getProviderRepository();

            // FIXME: This should be handled by the maven-scm git provider
            if ( providerRepo instanceof GitScmProviderRepository )
            {
                String branchName = GitBranchCommand.getCurrentBranch( new PlexusLogger( getLogger() ),
                                                                       (GitScmProviderRepository) providerRepo,
                                                                       workingDirSet );
                scmTag = new ScmBranch( branchName );
            }

            if ( workingDirectory.listFiles().length > 1 )
            {
                updateScmResult = provider.update( repository, workingDirSet, scmTag );
            }
            else
            {
                checkOutScmResult = provider.checkOut( repository, new ScmFileSet( workingDirectory ) );
                checkOutScmResult = provider.checkOut( repository, workingDirSet, scmTag );
            }
        }
        catch ( ScmException e )
        {
            throw new ReleaseExecutionException( "An error occurred while updating your local copy: " + e.getMessage(),
                                                 e );
        }

        if ( updateScmResult != null )
        {
View Full Code Here

                                                 additionalArguments, result, environments );
            }
        }
        catch ( Exception e )
        {
            throw new ReleaseExecutionException( result.getOutput(), e );
        }

        result.setResultCode( ReleaseResult.SUCCESS );

        return result;
View Full Code Here

        {
            reactorProjects.addAll( getReactorProjects( releaseDescriptor ) );
        }
        catch ( ContinuumReleaseException e )
        {
            throw new ReleaseExecutionException( "Unable to get reactor projects: " + e.getMessage(), e );
        }

        result.setResultCode( ReleaseResult.SUCCESS );

        return result;
View Full Code Here

TOP

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

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.