Examples of SnapshotVersion


Examples of org.apache.maven.archiva.model.SnapshotVersion

        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
        m.setGroupId( actualMetadata.getGroupId() );
        m.setArtifactId( actualMetadata.getArtifactId() );
        m.setVersion( VersionUtil.getBaseVersion( actualMetadata.getVersion() ) );

        m.setSnapshotVersion( new SnapshotVersion() );

        if ( StringUtils.isNotBlank( expectedDate ) && StringUtils.isNotBlank( expectedTime ) )
        {
            m.getSnapshotVersion().setTimestamp( expectedDate + "." + expectedTime );
        }
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
        m.setGroupId( actualMetadata.getGroupId() );
        m.setArtifactId( actualMetadata.getArtifactId() );
        m.setVersion( VersionUtil.getBaseVersion( actualMetadata.getVersion() ) );

        m.setSnapshotVersion( new SnapshotVersion() );

        if ( StringUtils.isNotBlank( expectedDate ) && StringUtils.isNotBlank( expectedTime ) )
        {
            m.getSnapshotVersion().setTimestamp( expectedDate + "." + expectedTime );
        }
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

            metadata.setAvailableVersions( xml.getElementListText( "//metadata/versioning/versions/version" ) );

            Element snapshotElem = xml.getElement( "//metadata/versioning/snapshot" );
            if ( snapshotElem != null )
            {
                SnapshotVersion snapshot = new SnapshotVersion();
                snapshot.setTimestamp( snapshotElem.elementTextTrim( "timestamp" ) );
                String tmp = snapshotElem.elementTextTrim( "buildNumber" );
                if( NumberUtils.isNumber( tmp ))
                {
                    snapshot.setBuildNumber( NumberUtils.toInt( tmp ) );
                }
                metadata.setSnapshotVersion( snapshot );
            }

            return metadata;
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

                    // There is no proxy metadata, skip it.
                    continue;
                }

                // Is there some snapshot info?
                SnapshotVersion snapshot = proxyMetadata.getSnapshotVersion();
                if ( snapshot != null )
                {
                    String timestamp = snapshot.getTimestamp();
                    int buildNumber = snapshot.getBuildNumber();

                    // Only interested in the timestamp + buildnumber.
                    if ( StringUtils.isNotBlank( timestamp ) && ( buildNumber > 0 ) )
                    {
                        foundVersions.add( baseVersion + "-" + timestamp + "-" + buildNumber );
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

                // This needs to be broken down into ${base}-${timestamp}-${build_number}

                Matcher m = VersionUtil.UNIQUE_SNAPSHOT_PATTERN.matcher( latestVersion );
                if ( m.matches() )
                {
                    metadata.setSnapshotVersion( new SnapshotVersion() );
                    int buildNumber = NumberUtils.toInt( m.group( 3 ), -1 );
                    metadata.getSnapshotVersion().setBuildNumber( buildNumber );

                    Matcher mtimestamp = VersionUtil.TIMESTAMP_PATTERN.matcher( m.group( 2 ) );
                    if ( mtimestamp.matches() )
                    {
                        String tsDate = mtimestamp.group( 1 );
                        String tsTime = mtimestamp.group( 2 );
                       
                        long snapshotLastUpdated = toLastUpdatedLong( tsDate + tsTime );
                       
                        lastUpdated = Math.max( lastUpdated, snapshotLastUpdated );
                       
                        metadata.getSnapshotVersion().setTimestamp( m.group( 2 ) );
                    }
                }
            }
            else if ( VersionUtil.isGenericSnapshot( latestVersion ) )
            {
                // The latestVersion ends with the generic version string.
                // Example: 1.0-alpha-5-SNAPSHOT

                metadata.setSnapshotVersion( new SnapshotVersion() );

                /* Disabled due to decision in [MRM-535].
                 * Do not set metadata.lastUpdated to file.lastModified.
                 *
                 * Should this be the last updated timestamp of the file, or in the case of an
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

                {
                    newBuildNumber = metadata.getSnapshotVersion().getBuildNumber() + 1;
                }
                else
                {
                  metadata.setSnapshotVersion( new SnapshotVersion() );
                  newBuildNumber = 1;
                }
            }

            if ( !targetPath.exists() )
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

            metadata.setAvailableVersions( xml.getElementListText( "//metadata/versioning/versions/version" ) );

            Element snapshotElem = xml.getElement( "//metadata/versioning/snapshot" );
            if ( snapshotElem != null )
            {
                SnapshotVersion snapshot = new SnapshotVersion();
                snapshot.setTimestamp( snapshotElem.elementTextTrim( "timestamp" ) );
                String tmp = snapshotElem.elementTextTrim( "buildNumber" );
                if( NumberUtils.isNumber( tmp ))
                {
                    snapshot.setBuildNumber( NumberUtils.toInt( tmp ) );
                }
                metadata.setSnapshotVersion( snapshot );
            }

            for ( Element plugin : xml.getElementList( "//metadata/plugins/plugin" ) )
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
        m.setGroupId( actualMetadata.getGroupId() );
        m.setArtifactId( actualMetadata.getArtifactId() );
        m.setVersion( VersionUtil.getBaseVersion( actualMetadata.getVersion() ) );

        m.setSnapshotVersion( new SnapshotVersion() );

        if ( StringUtils.isNotBlank( expectedDate ) && StringUtils.isNotBlank( expectedTime ) )
        {
            m.getSnapshotVersion().setTimestamp( expectedDate + "." + expectedTime );
        }
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

        if ( mainSnapshotVersion == null )
        {
            return ArchivaModelCloner.clone( sourceSnapshotVersion );
        }

        SnapshotVersion merged = new SnapshotVersion();

        merged.setTimestamp( merge( mainSnapshotVersion.getTimestamp(), sourceSnapshotVersion.getTimestamp() ) );
        merged
            .setBuildNumber( Math.max( mainSnapshotVersion.getBuildNumber(), sourceSnapshotVersion.getBuildNumber() ) );

        return merged;
    }
View Full Code Here

Examples of org.apache.maven.archiva.model.SnapshotVersion

                    // There is no proxy metadata, skip it.
                    continue;
                }

                // Is there some snapshot info?
                SnapshotVersion snapshot = proxyMetadata.getSnapshotVersion();
                if ( snapshot != null )
                {
                    String timestamp = snapshot.getTimestamp();
                    int buildNumber = snapshot.getBuildNumber();

                    // Only interested in the timestamp + buildnumber.
                    if ( StringUtils.isNotBlank( timestamp ) && ( buildNumber > 0 ) )
                    {
                        foundVersions.add( baseVersion + "-" + timestamp + "-" + buildNumber );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.