Package org.apache.maven.shared.release.versions

Examples of org.apache.maven.shared.release.versions.DefaultVersionInfo


        {
            model.setName( model.getArtifactId() );
        }
        params.put( "name", model.getName() );

        VersionInfo version = new DefaultVersionInfo( model.getVersion() );

        params.put( "release", version.getReleaseVersionString() );
        params.put( "dev", version.getNextVersion().getSnapshotVersionString() );

        projects.add( params );
    }
View Full Code Here


        {
            model.setName( model.getArtifactId() );
        }
        params.put( "name", model.getName() );

        VersionInfo version = new DefaultVersionInfo( model.getVersion() );

        params.put( "release", version.getReleaseVersionString() );
        params.put( "dev", version.getNextVersion().getSnapshotVersionString() );

        projects.add( params );
    }
View Full Code Here

        {
            while( nextVersion == null || ArtifactUtils.isSnapshot( nextVersion ) != convertToSnapshot )
            {
                if ( suggestedVersion == null )
                {
                    DefaultVersionInfo versionInfo;
                    try
                    {
                        String baseVersion = null;
                        if( convertToSnapshot )
                        {
                            baseVersion = getReleaseVersion( projectId, releaseDescriptor );
                        }
                        // unspecified and unmapped version, so use project version
                        if( baseVersion == null )
                        {
                            baseVersion = project.getVersion();
                        }
                        versionInfo = new DefaultVersionInfo( baseVersion );
                    }
                    catch ( VersionParseException e )
                    {
                        if( releaseDescriptor.isInteractive() )
                        {
                            try
                            {
                                versionInfo = 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 );
                            }
                        }
                        else
                        {
                            throw new ReleaseExecutionException( "Error parsing version, cannot determine next version: " + e.getMessage(), e );
                        }
                    }
                    suggestedVersion =
                        convertToSnapshot ? versionInfo.getNextVersion().getSnapshotVersionString()
                                        : versionInfo.getReleaseVersionString();
                }
               
                if( releaseDescriptor.isInteractive() )
                {
                    if( messageKey == null )
View Full Code Here

{

    public VersionPolicyResult getReleaseVersion( VersionPolicyRequest request )
        throws PolicyException, VersionParseException
    {
        String releaseVersion = new DefaultVersionInfo( request.getVersion() ).getReleaseVersionString();
        return new VersionPolicyResult().setVersion( releaseVersion );
    }
View Full Code Here

    }

    public VersionPolicyResult getDevelopmentVersion( VersionPolicyRequest request )
        throws PolicyException, VersionParseException
    {
        String developmentVersion = new DefaultVersionInfo( request.getVersion() ).getNextVersion().getSnapshotVersionString();
        return new VersionPolicyResult().setVersion( developmentVersion );
    }
View Full Code Here

        {
            Artifact currentArtifact = iterator.next();
            String versionlessKey = ArtifactUtils.versionlessKey( currentArtifact );

            Map<String, String> versionMap = new HashMap<String, String>();
            VersionInfo versionInfo = new DefaultVersionInfo( currentArtifact.getVersion() );
            versionMap.put( ReleaseDescriptor.ORIGINAL_VERSION, versionInfo.toString() );

            prompter.showMessage(
                "Dependency '" + versionlessKey + "' is a snapshot (" + currentArtifact.getVersion() + ")\n" );
            String result = prompter.prompt( "Which release version should it be set to?",
                                             versionInfo.getReleaseVersionString() );
            versionMap.put( ReleaseDescriptor.RELEASE_KEY, result );

            iterator.remove();

            // by default, keep the same version for the dependency after release, unless it was previously newer
            // the user may opt to type in something different
            VersionInfo nextVersionInfo = new DefaultVersionInfo( result );

            String nextVersion;
            if ( nextVersionInfo.compareTo( versionInfo ) > 0 )
            {
                nextVersion = nextVersionInfo.toString();
            }
            else
            {
                nextVersion = versionInfo.toString();
            }
View Full Code Here

    {
        return calculateNextVersion( request, true );
    }

    private VersionPolicyResult calculateNextVersion( VersionPolicyRequest request, boolean development ) {
        DefaultVersionInfo defaultVersionInfo = null;

        try
        {
            defaultVersionInfo = new DefaultVersionInfo( request.getVersion() );
        }
        catch ( VersionParseException e )
        {
            throw new IllegalArgumentException( "Can't tell if version with no digits is even: " + e.getMessage(), e );
        }
View Full Code Here

        {
            while ( nextVersion == null || ArtifactUtils.isSnapshot( nextVersion ) != convertToSnapshot )
            {
                if ( suggestedVersion == null )
                {
                    DefaultVersionInfo versionInfo;
                    try
                    {
                        String baseVersion = null;
                        if ( convertToSnapshot )
                        {
                            baseVersion = getReleaseVersion( projectId, releaseDescriptor );
                        }
                        // unspecified and unmapped version, so use project version
                        if ( baseVersion == null )
                        {
                            baseVersion = project.getVersion();
                        }
                        versionInfo = new DefaultVersionInfo( baseVersion );
                    }
                    catch ( VersionParseException e )
                    {
                        if ( releaseDescriptor.isInteractive() )
                        {
                            try
                            {
                                versionInfo = 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 );
                            }
                        }
                        else
                        {
                            throw new ReleaseExecutionException(
                                                                 "Error parsing version, cannot determine next version: "
                                                                     + e.getMessage(), e );
                        }
                    }
                    suggestedVersion =
                        convertToSnapshot ? versionInfo.getNextVersion().getSnapshotVersionString()
                                        : versionInfo.getReleaseVersionString();
                }
               
                if ( releaseDescriptor.isInteractive() )
                {
                    if ( messageKey == null )
View Full Code Here

        {
            model.setName( model.getArtifactId() );
        }
        params.put( "name", model.getName() );

        VersionInfo version = new DefaultVersionInfo( model.getVersion() );

        params.put( "release", version.getReleaseVersionString() );
        params.put( "dev", version.getNextVersion().getSnapshotVersionString() );

        projects.add( params );
    }
View Full Code Here

        String suggestedVersion = null;
        String releaseVersion = defaultVersion;
       
        while(null == releaseVersion || ArtifactUtils.isSnapshot(releaseVersion))
        {
            DefaultVersionInfo info = null;
            try
            {
               info = new DefaultVersionInfo(rootProject.getVersion());
            }
            catch (VersionParseException e)
            {
                if (ctx.isInteractive())
                {
                    try
                    {
                        info = new DefaultVersionInfo("1.0");
                    }
                    catch (VersionParseException e1)
                    {
                        throw new JGitFlowReleaseException("error parsing 1.0 version!!!", e1);
                    }
                }
                else
                {
                    throw new JGitFlowReleaseException("error parsing release version: " + e.getMessage(),e);
                }
            }
           
            suggestedVersion = info.getReleaseVersionString();

            if(ctx.isInteractive())
            {
                String message = MessageFormat.format("What is the release version for \"{0}\"? ({1})",rootProject.getName(), ArtifactUtils.versionlessKey(rootProject.getGroupId(), rootProject.getArtifactId()));
                try
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.release.versions.DefaultVersionInfo

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.