Examples of GAV


Examples of org.apache.maven.index.artifact.Gav

    }

    public void testGavSnapshotVersion()
        throws Exception
    {
        Gav gav;

        gav =
            gavCalculator.pathToGav( "/org/sonatype/nexus/nexus-webapp/1.0.0-beta-5-SNAPSHOT/nexus-webapp-1.0.0-beta-5-SNAPSHOT.tar.gz" );
        assertNotNull( gav );
        assertEquals( "tar.gz", gav.getExtension() );
        assertEquals( null, gav.getClassifier() );
        assertEquals( "1.0.0-beta-5-SNAPSHOT", gav.getVersion() );
        assertTrue( gav.isSnapshot() );

        gav =
            gavCalculator.pathToGav( "/org/sonatype/nexus/nexus-webapp/1.0.0-beta-5-SNAPSHOT-1234/nexus-webapp-1.0.0-beta-5-SNAPSHOT-1234.tar.gz" );
        assertNotNull( gav );
        assertEquals( "tar.gz", gav.getExtension() );
        assertEquals( null, gav.getClassifier() );
        assertEquals( "1.0.0-beta-5-SNAPSHOT-1234", gav.getVersion() );
        assertFalse( gav.isSnapshot() );

        gav =
            gavCalculator.pathToGav( "/org/sonatype/nexus/nexus-webapp/1.0.0-beta-5-SNAPSHOT/nexus-webapp-1.0.0-beta-5-SNAPSHOT-bundle.tar.gz" );
        assertNotNull( gav );
        assertEquals( "tar.gz", gav.getExtension() );
        assertEquals( "bundle", gav.getClassifier() );
        assertEquals( "1.0.0-beta-5-SNAPSHOT", gav.getVersion() );
        assertTrue( gav.isSnapshot() );

        gav =
            gavCalculator.pathToGav( "/org/sonatype/nexus/nexus-webapp/1.0.0-beta-5-SNAPSHOT-1234/nexus-webapp-1.0.0-beta-5-SNAPSHOT-1234-bundle.tar.gz" );
        assertNotNull( gav );
        assertEquals( "tar.gz", gav.getExtension() );
        assertEquals( "bundle", gav.getClassifier() );
        assertEquals( "1.0.0-beta-5-SNAPSHOT-1234", gav.getVersion() );
        assertFalse( gav.isSnapshot() );
    }
View Full Code Here

Examples of org.apache.maven.index.artifact.Gav

    }

    public void testGavLooseStrictedSnapshot()
        throws Exception
    {
        Gav gav;

        gav = gavCalculator.pathToGav( "/org/sonatype/nexus-3148/1.0.SNAPSHOT/nexus-3148-1.0.20100111.064938-1.pom" );
        assertNotNull( gav );
        assertEquals( "pom", gav.getExtension() );
        assertEquals( "1.0.20100111.064938-1", gav.getVersion() );
        assertEquals( "1.0.SNAPSHOT", gav.getBaseVersion() );
        assertEquals( "org.sonatype", gav.getGroupId() );
        assertEquals( "nexus-3148", gav.getArtifactId() );
        assertEquals( null, gav.getClassifier() );
        assertEquals( "pom", gav.getExtension() );
        assertEquals( new Integer( 1 ), gav.getSnapshotBuildNumber() );
        // the timestamp is UTC, not EST timezoned!
        // also, the Gav is it seems TZ sensitive!!!
        assertEquals( parseTimestamp( "20100111.064938" ), gav.getSnapshotTimeStamp() );
        assertEquals( "nexus-3148-1.0.20100111.064938-1.pom", gav.getName() );
        assertEquals( true, gav.isSnapshot() );
        assertEquals( false, gav.isHash() );
        assertEquals( null, gav.getHashType() );

        String path = gavCalculator.gavToPath( gav );
        assertEquals( "/org/sonatype/nexus-3148/1.0.SNAPSHOT/nexus-3148-1.0.20100111.064938-1.pom", path );
    }
View Full Code Here

Examples of org.apache.maven.index.artifact.Gav

        ArtifactInfo artifactInfo = new ArtifactInfo( "test", "aopalliance", "aopalliance", "1.0-SNAPSHOT", null );

        M2GavCalculator gavCalc = new M2GavCalculator();

        Gav jarGav = gavCalc.pathToGav( "aopalliance/aopalliance/1.0/aopalliance-1.0.jar" );
        Gav pomGav = gavCalc.pathToGav( "aopalliance/aopalliance/1.0/aopalliance-1.0.pom" );

        ArtifactContext artifactContext = new ArtifactContext( pom, artifact, null, artifactInfo, jarGav );

        indexer.addArtifactToIndex( artifactContext, context );
View Full Code Here

Examples of org.apache.maven.index.artifact.Gav

        final M2GavCalculator gavCalculator = new M2GavCalculator();

        final File pomFile =
            getTestFile( "src/test/repo/ch/marcus-schulte/maven/hivedoc-plugin/1.0.0/hivedoc-plugin-1.0.0.pom" );

        final Gav gav =
            gavCalculator.pathToGav( "/ch/marcus-schulte/maven/hivedoc-plugin/1.0.0/hivedoc-plugin-1.0.0.pom" );

        File artifactFile = al.locate( pomFile, gavCalculator, gav );

        assertTrue( "Artifact file was not located!", artifactFile != null );
View Full Code Here

Examples of org.apache.maven.index.artifact.Gav

        String path = createPath( groupId, artifactId, version, classifier );
        File pomFile = new File( path + ".pom" );
        File artifact = new File( path + ".jar" );
        File metadata = null;
        ArtifactInfo artifactInfo = new ArtifactInfo( repositoryId, groupId, artifactId, version, classifier );
        Gav gav =
            new Gav( groupId, artifactId, version, classifier, "jar", null, null, artifact.getName(), false,
                null, false, null );
        return new ArtifactContext( pomFile, artifact, metadata, artifactInfo, gav );
    }
View Full Code Here

Examples of org.apache.maven.index.artifact.Gav

        return groupId;
    }

    public Gav calculateGav()
    {
        return new Gav( groupId, artifactId, version, classifier, fextension, null, // snapshotBuildNumber
            null, // snapshotTimeStamp
            fname, // name
            false, // hash
            null, // hashType
            false, // signature
View Full Code Here

Examples of org.ebayopensource.nexus.plugins.artifactusage.store.GAV

  }

  public void testGetGavFromSimplePom() throws Exception {
    StorageFileItem pomFileItem = getMockStorageFileItem("src/test/remote-repo/test/artifactusage/simple-artifact/1.0/simple-artifact-1.0.pom");

    GAV artifact = ((DefaultArtifactUsageCalculator) this
        .lookup(ArtifactUsageCalculator.class))
        .getArtifactForStorageItem(pomFileItem);
    assertNotNull(artifact);
    assertEquals("test.artifactusage", artifact.getGroupId());
    assertEquals("simple-artifact", artifact.getArtifactId());
    assertEquals("1.0", artifact.getVersion());
  }
View Full Code Here

Examples of org.ebayopensource.nexus.plugins.artifactusage.store.GAV

  }

  public void testGetGavFromPomWithParent() throws Exception {
    StorageFileItem pomFileItem = getMockStorageFileItem("src/test/remote-repo/test/artifactusage/artifact-with-parent/1.0/artifact-with-parent-1.0.pom");

    GAV artifact = ((DefaultArtifactUsageCalculator) this
        .lookup(ArtifactUsageCalculator.class))
        .getArtifactForStorageItem(pomFileItem);
    assertNotNull(artifact);
    assertEquals("test.artifactusage", artifact.getGroupId());
    assertEquals("artifact-with-parent", artifact.getArtifactId());
    assertEquals("1.9.1", artifact.getVersion());

  }
View Full Code Here

Examples of org.ebayopensource.nexus.plugins.artifactusage.store.GAV

  }

  public void testGetGavFromPomWithProperties() throws Exception {
    StorageFileItem pomFileItem = getMockStorageFileItem("src/test/remote-repo/test/artifactusage/artifact-with-properties/1.0/artifact-with-properties-1.0.pom");

    GAV artifact = ((DefaultArtifactUsageCalculator) this
        .lookup(ArtifactUsageCalculator.class))
        .getArtifactForStorageItem(pomFileItem);
    assertNotNull(artifact);
    assertEquals("test.artifactusage", artifact.getGroupId());
    assertEquals("artifact-with-properties", artifact.getArtifactId());
    assertEquals("${this-version}", artifact.getVersion());

  }
View Full Code Here

Examples of org.ebayopensource.nexus.plugins.artifactusage.store.GAV

      type = "json";
    } else if (artifactGav.endsWith(".xml")) {
      artifactGav = artifactGav.substring(0, artifactGav.length() - 4);
    }

    GAV gav = new GAV(artifactGav);
    Collection<ArtifactUser> artifactUsers = artifactUsageStore
        .getArtifactUsers(gav);

    // if the client wanted JSON, setup the appropriate Representation
    if ("json".equals(type)) {
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.