Package org.apache.maven.artifact.repository.metadata

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


        assertEquals( "Check file matches", expectedFile, proxied.getFile() );
    }

    private static Versioning getVersioning( List versions, File file )
    {
        Versioning versioning = new Versioning();
        for ( Iterator i = versions.iterator(); i.hasNext(); )
        {
            String v = (String) i.next();
            versioning.addVersion( v );
        }
        setLastUpdatedTimestamp( versioning, file );
        return versioning;
    }
View Full Code Here


        return getExpectedMetadata( artifactId, version, null );
    }

    private static Versioning getVersioning( String timestamp, int buildNumber, File file )
    {
        Versioning versioning = new Versioning();
        versioning.setSnapshot( new Snapshot() );
        versioning.getSnapshot().setTimestamp( timestamp );
        versioning.getSnapshot().setBuildNumber( buildNumber );
        setLastUpdatedTimestamp( versioning, file );
        return versioning;
    }
View Full Code Here

   
    public void testMetadataMissingLastUpdated()
    {
        Artifact artifact = artifactFactory.createBuildArtifact( "groupId", "artifactId", "1.0-alpha-1", "type" );

        Versioning versioning = new Versioning();
        versioning.addVersion( "1.0-alpha-1" );
        versioning.addVersion( "1.0-alpha-2" );

        RepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact, versioning );

        badMetadataReportProcessor.processMetadata( metadata, repository );
View Full Code Here

    public void testMetadataValidVersions()
    {
        Artifact artifact = artifactFactory.createBuildArtifact( "groupId", "artifactId", "1.0-alpha-1", "type" );

        Versioning versioning = new Versioning();
        versioning.addVersion( "1.0-alpha-1" );
        versioning.addVersion( "1.0-alpha-2" );
        versioning.setLastUpdated( "20050611.202020" );

        RepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact, versioning );

        badMetadataReportProcessor.processMetadata( metadata, repository );
View Full Code Here

    public void testMetadataMissingADirectory()
    {
        Artifact artifact = artifactFactory.createBuildArtifact( "groupId", "artifactId", "1.0-alpha-1", "type" );

        Versioning versioning = new Versioning();
        versioning.addVersion( "1.0-alpha-1" );
        versioning.setLastUpdated( "20050611.202020" );

        RepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact, versioning );

        badMetadataReportProcessor.processMetadata( metadata, repository );
View Full Code Here

    public void testMetadataInvalidArtifactVersion()
    {
        Artifact artifact = artifactFactory.createBuildArtifact( "groupId", "artifactId", "1.0-alpha-1", "type" );

        Versioning versioning = new Versioning();
        versioning.addVersion( "1.0-alpha-1" );
        versioning.addVersion( "1.0-alpha-2" );
        versioning.addVersion( "1.0-alpha-3" );
        versioning.setLastUpdated( "20050611.202020" );

        RepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact, versioning );

        badMetadataReportProcessor.processMetadata( metadata, repository );
View Full Code Here

    public void testMoreThanOneMetadataVersionErrors()
    {
        Artifact artifact = artifactFactory.createBuildArtifact( "groupId", "artifactId", "1.0-alpha-1", "type" );

        Versioning versioning = new Versioning();
        versioning.addVersion( "1.0-alpha-1" );
        versioning.addVersion( "1.0-alpha-3" );
        versioning.setLastUpdated( "20050611.202020" );

        RepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact, versioning );

        badMetadataReportProcessor.processMetadata( metadata, repository );
View Full Code Here

    private void setLastUpdatedIfEmpty( Metadata metadata, File metadataFile )
    {
        if ( metadata.getVersioning() == null )
        {
            metadata.setVersioning( new Versioning() );
        }
        if ( metadata.getVersioning().getLastUpdated() == null )
        {
            DateFormat fmt = new SimpleDateFormat( "yyyyMMddHHmmss", Locale.US );
            fmt.setTimeZone( UTC_TIMEZONE );
View Full Code Here

        ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );

        artifact = artifactFactory.createBuildArtifact( "groupId", "artifactId", "1.0-alpha-1", "type" );

        Versioning versioning = new Versioning();
        versioning.addVersion( "1.0-alpha-1" );
        versioning.addVersion( "1.0-alpha-2" );

        metadata = new ArtifactRepositoryMetadata( artifact, versioning );
    }
View Full Code Here

            if ( copyPom( artifact, targetRepository, transaction ) )
            {
                if ( copyArtifact( artifact, targetRepository, transaction ) )
                {
                    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.valueOf( matcher.group( 3 ) ).intValue() );
                        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,
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.repository.metadata.Versioning

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.