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

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


        HotfixVersionInfo hotfixInfo = null;
        if (StringUtils.isNotBlank(lastRelease) && !ArtifactUtils.isSnapshot(lastRelease))
        {
            try
            {
                DefaultVersionInfo projectInfo = new DefaultVersionInfo(projectVersion);
                DefaultVersionInfo lastReleaseInfo = new DefaultVersionInfo(lastRelease);
               
                String higherVersion = projectVersion;
               
                if(projectInfo.isSnapshot())
                {
View Full Code Here


        String suggestedVersion = null;
        String developmentVersion = defaultVersion;

        while(null == developmentVersion || !ArtifactUtils.isSnapshot(developmentVersion))
        {
            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 development version: " + e.getMessage(),e);
                }
            }

            suggestedVersion = info.getNextVersion().getSnapshotVersionString();

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

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

            Map versionMap = new HashMap();
            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

        VersionInfo nextSnapshotVersionInfo = null;
        boolean nextSnapshotVersionIsExplicit = false;

        try
        {
            currentVersionInfo = new DefaultVersionInfo( project.getVersion() );

            // The release/branch version defaults to currentVersionInfo (snapshot for branch, and release for tag)
            releaseVersionInfo = currentVersionInfo;

            // Check if the user specified a release version
            if ( releaseDescriptor.getDefaultReleaseVersion() != null )
            {
                releaseVersionInfo = new DefaultVersionInfo( releaseDescriptor.getDefaultReleaseVersion() );
                releaseVersionIsExplicit = true;
            }
            if ( releaseDescriptor.getReleaseVersions() != null )
            {
                String releaseVersion = ( String ) releaseDescriptor.getReleaseVersions().get( projectId );
                if ( releaseVersion != null )
                {
                    releaseVersionInfo = new DefaultVersionInfo( releaseVersion );
                    releaseVersionIsExplicit = true;
                }
            }

            // The next snapshot version defaults to the next version after the release version
            nextSnapshotVersionInfo = releaseVersionInfo.getNextVersion();

            // Check if the user specified a new snapshot version
            if ( releaseDescriptor.getDefaultDevelopmentVersion() != null )
            {
                nextSnapshotVersionInfo = new DefaultVersionInfo( releaseDescriptor.getDefaultDevelopmentVersion() );
                nextSnapshotVersionIsExplicit = true;
            }
            if ( releaseDescriptor.getDevelopmentVersions() != null )
            {
                String nextDevVersion = ( String ) releaseDescriptor.getDevelopmentVersions().get( projectId );
                if ( nextDevVersion != null )
                {
                    nextSnapshotVersionInfo = new DefaultVersionInfo( nextDevVersion );
                    nextSnapshotVersionIsExplicit = true;
                }
            }

        }
        catch ( VersionParseException e )
        {
            String msg = "Error parsing version, cannot determine next version: " + e.getMessage();
            if ( releaseDescriptor.isInteractive() )
            {
                logWarn( result, msg );
                logDebug( result, e.getMessage(), e );

                // set defaults for resume in interactive mode
                if ( releaseVersionInfo == null )
                {
                    try
                    {
                        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 );
View Full Code Here

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

        if ( !autoVersionSubmodules || projects.size() == 0 )
        {
            VersionInfo version = new DefaultVersionInfo( model.getVersion() );
            params.put( "release", version.getReleaseVersionString() );
            params.put( "dev", version.getNextVersion().getSnapshotVersionString() );
        }
        else
        {
            Map<String, String> rootParams = projects.get( 0 ); // get the root map
            params.put( "release", rootParams.get( "release" ) );
View Full Code Here

            if(log.isDebugEnabled())
            {
                log.debug("looping until we find a non-snapshot version...");
            }
           
            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(log.isDebugEnabled())
            {
                log.debug("suggestedVersion: " + suggestedVersion);
            }
View Full Code Here

        HotfixVersionInfo hotfixInfo = null;
        if (StringUtils.isNotBlank(lastRelease) && !ArtifactUtils.isSnapshot(lastRelease))
        {
            try
            {
                DefaultVersionInfo projectInfo = new DefaultVersionInfo(projectVersion);
                DefaultVersionInfo lastReleaseInfo = new DefaultVersionInfo(lastRelease);
               
                String higherVersion = projectVersion;
               
                if(projectInfo.isSnapshot())
                {
View Full Code Here

        String suggestedVersion = null;
        String developmentVersion = defaultVersion;

        while(null == developmentVersion || !ArtifactUtils.isSnapshot(developmentVersion))
        {
            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 development version: " + e.getMessage(),e);
                }
            }

            suggestedVersion = info.getNextVersion().getSnapshotVersionString();

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

            String currentVersion = getCurrentProjectVersion();

            String nextSnapshotVersion = null;
            // get next snapshot version
            try {
                DefaultVersionInfo versionInfo = new DefaultVersionInfo(
                        currentVersion);
                nextSnapshotVersion = versionInfo.getNextVersion()
                        .getSnapshotVersionString();
            } catch (VersionParseException e) {
                if (getLog().isDebugEnabled()) {
                    getLog().debug(e);
                }
View Full Code Here

                String currentVersion = getCurrentProjectVersion();

                String nextSnapshotVersion = null;
                // get next snapshot version
                try {
                    DefaultVersionInfo versionInfo = new DefaultVersionInfo(
                            currentVersion);
                    nextSnapshotVersion = versionInfo.getNextVersion()
                            .getSnapshotVersionString();
                } catch (VersionParseException e) {
                    if (getLog().isDebugEnabled()) {
                        getLog().debug(e);
                    }
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.