Package org.sonatype.nexus.proxy.maven.gav

Examples of org.sonatype.nexus.proxy.maven.gav.Gav


    if (!StringUtils.isEmpty(latest) && Gav.isSnapshot(latest)) {
      if (log.isDebugEnabled()) {
        log.debug("Resolved gav version from '" + gav.getVersion() + "' to '" + latest + "'");
      }

      Gav result =
          new Gav(gav.getGroupId(), gav.getArtifactId(), latest, gav.getClassifier(), gav.getExtension(),
              buildNo, buildTs, gav.getName(), gav.isHash(), gav.getHashType(), gav.isSignature(),
              gav.getSignatureType());

      return result;
    }
View Full Code Here


          StringUtils.defaultString(gav.getClassifier(), ""))) {
        Long buildTs = getTimeFromMetadataTimestampMaven3Updated(sv.getUpdated());

        Integer buildNo = getBuildNumberForMetadataMaven3Value(sv.getVersion());

        return new Gav(gav.getGroupId(), gav.getArtifactId(), sv.getVersion(), gav.getClassifier(),
            gav.getExtension(), buildNo, buildTs, gav.getName(), gav.isHash(), gav.getHashType(),
            gav.isSignature(), gav.getSignatureType());

      }
    }
View Full Code Here

  }

  public StorageFileItem retrieveArtifactPom(ArtifactStoreRequest gavRequest)
      throws IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException
  {
    Gav pomGav =
        new Gav(
            gavRequest.getGav().getGroupId(),
            gavRequest.getGav().getArtifactId(),
            gavRequest.getGav().getVersion(),
            null, // gavRequest.getGav().getClassifier(),
            "pom", // gavRequest.getGav().getExtension(),
View Full Code Here

      throws IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException
  {
    checkRequest(gavRequest);

    try {
      Gav gav = repository.getMetadataManager().resolveArtifact(gavRequest);

      if (gav == null) {
        throw new ItemNotFoundException(reasonFor(gavRequest, repository,
            "Request %s is not resolvable in repository %s", gavRequest.getRequestPath(),
            RepositoryStringUtils.getHumanizedNameString(repository)));
View Full Code Here

  public StorageFileItem retrieveArtifact(ArtifactStoreRequest gavRequest)
      throws IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException
  {
    checkRequest(gavRequest);

    Gav gav = resolveArtifact(gavRequest);

    gavRequest.setRequestPath(repository.getGavCalculator().gavToPath(gav));

    StorageItem item = repository.retrieveItem(gavRequest);
View Full Code Here

      throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException,
             StorageException, AccessDeniedException
  {
    checkRequest(gavRequest);

    Gav gav =
        new Gav(gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(),
            gavRequest.getClassifier(), "pom", null, null, null, false, null, false, null);

    gavRequest.setRequestPath(repository.getGavCalculator().gavToPath(gav));

    repository.storeItemWithChecksums(gavRequest, is, attributes);
View Full Code Here

      throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException,
             StorageException, AccessDeniedException
  {
    checkRequest(gavRequest);

    Gav gav =
        new Gav(gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(),
            gavRequest.getClassifier(), gavRequest.getExtension(), null, null, null, false, null, false, null);

    gavRequest.setRequestPath(repository.getGavCalculator().gavToPath(gav));

    repository.storeItemWithChecksums(gavRequest, is, attributes);
View Full Code Here

             StorageException, AccessDeniedException
  {
    checkRequest(gavRequest);

    // Force classifier to null, as the pom shouldn't have a classifier
    final Gav pomGav =
        new Gav(gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), null, "pom", null,
            null, null, false, null, false, null);
    final ArtifactStoreRequest pomRequest = new ArtifactStoreRequest(gavRequest.getMavenRepository(), pomGav, false);
    pomRequest.getRequestContext().setParentContext(gavRequest.getRequestContext());

    try {
View Full Code Here

    return new M2TestsuiteEnvironmentBuilder("repo1");
  }

  @Test
  public void testNoDots() throws Exception {
    Gav gav = new Gav("nodots", "artifact", "1.0", null, "xml", null, null, null, false, null, false, null);
    MavenRepository mavenRepository = (MavenRepository) this.getRepositoryRegistry().getRepository("repo1");
    ArtifactStoreRequest request = new ArtifactStoreRequest(mavenRepository, gav, true, false);

    Assert.assertEquals("/nodots/artifact/1.0/artifact-1.0.xml", request.getRequestPath());
  }
View Full Code Here

    Assert.assertEquals("/nodots/artifact/1.0/artifact-1.0.xml", request.getRequestPath());
  }

  @Test
  public void testDots() throws Exception {
    Gav gav = new Gav("a.bunch.of.dots.yeah", "artifact", "1.0", null, "xml", null, null, null, false, null, false,
        null);
    MavenRepository mavenRepository = (MavenRepository) this.getRepositoryRegistry().getRepository("repo1");
    ArtifactStoreRequest request = new ArtifactStoreRequest(mavenRepository, gav, true, false);

    Assert.assertEquals("/a/bunch/of/dots/yeah/artifact/1.0/artifact-1.0.xml", request.getRequestPath());
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.maven.gav.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.