Package org.apache.maven.index.artifact

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


        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

        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

        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

        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

  @Test
  public void downloadSnapshotPlugin()
      throws Throwable
  {
    final Gav gav = GavUtil.newGav("org.apache.maven.plugins", "maven-invoker-plugin", "1.6-SNAPSHOT");

    downloadFile(
        new URL(
            "http://localhost:"
                + TestProperties.getInteger("webproxy-server-port")
                +
                "/nexus3638/org/apache/maven/plugins/maven-invoker-plugin/1.6-SNAPSHOT/maven-invoker-plugin-1.6-20100922.124315-3.jar"),
        "target/downloads/nexus3638");

    Thread[] threads = new Thread[10];
    final Throwable[] errors = new Throwable[threads.length];
    for (int i = 0; i < threads.length; i++) {
      Thread thread = new Downloader(this, gav, i, errors);

      threads[i] = thread;
    }

    // launch them all
    for (Thread thread : threads) {
      thread.start();
    }

    // w8 all to finish
    for (Thread thread : threads) {
      thread.join();
    }

    // check for errors
    for (Throwable throwable : errors) {
      if (throwable != null) {
        throw throwable;
      }
    }

    // make sure it does have enough time to index the artifact!
    TaskScheduleUtil.waitForAllTasksToStop();

    List<NexusArtifact> items =
        getSearchMessageUtil().searchForGav(gav.getGroupId(), gav.getArtifactId(), gav.getVersion(), "nexus3638");
    Assert.assertFalse(items.isEmpty());
    Assert.assertEquals(items.get(0).getPackaging(), "maven-plugin");

    final File nexusLog = getNexusLogFile();
View Full Code Here

    final File pom = getTestFile("wagon.pom");
    final File sha1 = new File(pom.getParentFile(), "wagon.pom.sha1");
    FileUtils.write(sha1, FileTestingUtils.createSHA1FromFile(pom));

    final String repo = getRepositoryUrl(REPO_TEST_HARNESS_REPO);
    final Gav gav = GavUtil.newGav("nexus3233", "wagon", "1.0.0", "pom");
    final String path = getRelitiveArtifactPath(gav);
    getDeployUtils().deployWithWagon("http", repo, pom, path);
    getDeployUtils().deployWithWagon("http", repo, sha1, path + ".sha1");
    searchFor(pom);
  }
View Full Code Here

  public void outOfServiceTest()
      throws Exception
  {

    // get an artifact
    Gav gav =
        new Gav(this.getTestId(), "out-of-service", "0.1.8-four-beta18", null, "jar", 0, new Date().getTime(),
            "Simple Test Artifact", false, null, false, null);

    // download an artifact
    File originalFile = this.downloadArtifact(getNexusTestRepoUrl(), gav, "target/downloads/original");
View Full Code Here

    serverResource.getServerProvider().stop();

    // delete everything under this tests group id if exist anything
    this.deleteFromRepository(getTestRepositoryId(), "nexus179/");

    Gav gav =
        new Gav(this.getTestId(), "repo-down-test-artifact", "1.0.0", null, "xml", 0, new Date().getTime(),
            "Simple Test Artifact", false, null, false, null);

    File localFile = this.getLocalFile(REPO_RELEASE_PROXY_REPO1, gav);

    // make sure this exists first, or the test is invalid anyway.
View Full Code Here

  @Test
  public void expireCache()
      throws Exception
  {
    Gav gav = GavUtil.newGav(getTestId(), "project", "1.0");
    failDownload(gav);

    File dest = new File(localStorageDir, "nexus977tasks/1/nexus977tasks/project/1.0/project-1.0.jar");
    dest.getParentFile().mkdirs();
    FileUtils.copyFile(getTestFile("project.jar"), dest);
View Full Code Here

TOP

Related Classes of org.apache.maven.index.artifact.Gav

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.