Examples of Versioning


Examples of org.apache.maven.artifact.repository.metadata.Versioning

                Metadata metadata = snapshotMetadata.getMetadata();

                if ( metadata != null )
                {
                    Versioning versioning = metadata.getVersioning();

                    if ( versioning != null )
                    {
                        Snapshot snapshot = versioning.getSnapshot();

                        if ( snapshot != null )
                        {
                            // TODO is it possible to have more than one SnapshotArtifactRepositoryMetadata
                            localCopy = snapshot.isLocalCopy();
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

                    SnapshotArtifactRepositoryMetadata snapshotMetadata = (SnapshotArtifactRepositoryMetadata) m;

                    Metadata metadata = snapshotMetadata.getMetadata();
                    if ( metadata != null )
                    {
                        Versioning versioning = metadata.getVersioning();
                        if ( versioning != null )
                        {
                            Snapshot snapshot = versioning.getSnapshot();
                            if ( snapshot != null )
                            {
                                localCopy = snapshot.isLocalCopy();
                            }
                        }
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

            getLog().warn( "Execution skipped" );
            return;
        }
        Artifact projectArtifact = project.getArtifact();

        Versioning versioning = new Versioning();
        versioning.setLatest( projectArtifact.getVersion() );
        versioning.updateTimestamp();
        ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( projectArtifact, versioning );
        projectArtifact.addMetadata( metadata );

        GroupRepositoryMetadata groupMetadata = new GroupRepositoryMetadata( project.getGroupId() );
        groupMetadata.addPluginMapping( getGoalPrefix(), project.getArtifactId(), project.getName() );
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

            addWarning( artifact, Messages.getString( "unable.to.copy.artifact" ) ); //$NON-NLS-1$
            return;
        }

        Metadata metadata = createBaseMetadata( artifact );
        Versioning versioning = new Versioning();
        versioning.addVersion( artifact.getBaseVersion() );
        metadata.setVersioning( versioning );
        updateMetadata( new ArtifactRepositoryMetadata( artifact ), targetRepository, metadata, transaction );

        metadata = createBaseMetadata( artifact );
        metadata.setVersion( artifact.getBaseVersion() );
        versioning = new Versioning();

        Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher( artifact.getVersion() );
        if ( matcher.matches() )
        {
            Snapshot snapshot = new Snapshot();
            snapshot.setBuildNumber( Integer.parseInt( matcher.group( 3 ) ) );
            snapshot.setTimestamp( matcher.group( 2 ) );
            versioning.setSnapshot( snapshot );
        }

        // TODO: merge latest/release/snapshot from source instead
        metadata.setVersioning( versioning );
        updateMetadata( new SnapshotArtifactRepositoryMetadata( artifact ), targetRepository, metadata, transaction );
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

            Snapshot snapshot = new Snapshot();
            snapshot.setLocalCopy( true );
            artifact.addMetadata( new SnapshotArtifactRepositoryMetadata( artifact, snapshot ) );
        }

        Versioning versioning = new Versioning();
        versioning.updateTimestamp();
        versioning.addVersion( artifact.getBaseVersion() );
        if ( artifact.isRelease() )
        {
            versioning.setRelease( artifact.getBaseVersion() );
        }
        artifact.addMetadata( new ArtifactRepositoryMetadata( artifact, versioning ) );
    }
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

            if ( repository == null )
            {
                repository = session.getLocalRepository();
            }

            Versioning versioning = readVersions( session, metadataResult.getMetadata(), repository, result );
            for ( String version : versioning.getVersions() )
            {
                if ( !versionIndex.containsKey( version ) )
                {
                    versionIndex.put( version, repository );
                }
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

    }

    private Versioning readVersions( RepositorySystemSession session, Metadata metadata, ArtifactRepository repository,
                                     VersionRangeResult result )
    {
        Versioning versioning = null;

        FileInputStream fis = null;
        try
        {
            if ( metadata != null && metadata.getFile() != null )
            {
                fis = new FileInputStream( metadata.getFile() );
                org.apache.maven.artifact.repository.metadata.Metadata m = new MetadataXpp3Reader().read( fis, false );
                versioning = m.getVersioning();
            }
        }
        catch ( FileNotFoundException e )
        {
            // tolerable
        }
        catch ( Exception e )
        {
            invalidMetadata( session, metadata, repository, e );
            result.addException( e );
        }
        finally
        {
            IOUtil.close( fis );
        }

        return ( versioning != null ) ? versioning : new Versioning();
    }
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

    private static Metadata createMetadata( Artifact artifact )
    {
        Snapshot snapshot = new Snapshot();
        snapshot.setLocalCopy( true );
        Versioning versioning = new Versioning();
        versioning.setSnapshot( snapshot );

        Metadata metadata = new Metadata();
        metadata.setVersioning( versioning );
        metadata.setGroupId( artifact.getGroupId() );
        metadata.setArtifactId( artifact.getArtifactId() );
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

        }
    }

    private void mergeMetadata( Versions versions, Metadata source, ArtifactRepository repository )
    {
        Versioning versioning = source.getVersioning();
        if ( versioning != null )
        {
            String timestamp = StringUtils.clean( versioning.getLastUpdated() );

            if ( StringUtils.isNotEmpty( versioning.getRelease() )
                && timestamp.compareTo( versions.releaseTimestamp ) > 0 )
            {
                versions.releaseVersion = versioning.getRelease();
                versions.releaseTimestamp = timestamp;
                versions.releaseRepository = repository;
            }

            if ( StringUtils.isNotEmpty( versioning.getLatest() )
                && timestamp.compareTo( versions.latestTimestamp ) > 0 )
            {
                versions.latestVersion = versioning.getLatest();
                versions.latestTimestamp = timestamp;
                versions.latestRepository = repository;
            }
        }
    }
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Versioning

        this.artifact = artifact;
    }

    private static Metadata createMetadata( Artifact artifact )
    {
        Versioning versioning = new Versioning();
        versioning.addVersion( artifact.getBaseVersion() );
        if ( !artifact.isSnapshot() )
        {
            versioning.setRelease( artifact.getBaseVersion() );
        }
        if ( "maven-plugin".equals( artifact.getProperty( ArtifactProperties.TYPE, "" ) ) )
        {
            versioning.setLatest( artifact.getBaseVersion() );
        }

        Metadata metadata = new Metadata();
        metadata.setVersioning( versioning );
        metadata.setGroupId( artifact.getGroupId() );
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.