Package org.dru.clay.respository.artifact

Examples of org.dru.clay.respository.artifact.Artifact


      final ConfigurationContext context = resolveQueue.poll();
      final Dependency dependency = context.getDependency();
      final Group group = dependency.getGroup();
      final UnresolvedArtifact unresolved = dependency.getArtifact();

      final Artifact resolveArtifact = repository.lookup(transport, group, unresolved);

      logger.info("Resolved %s -> %s", unresolved, resolveArtifact);

      // TODO: Handle version conflicts
      if (visitedArtifacts.contains(resolveArtifact)) {
View Full Code Here


    if (!module.getGroup().get().equals(organisation)) {
      throw new IllegalArgumentException("Ivy description of artifact has different organisation than the resolve artifact: "
          + organisation);
    }

    final Artifact artifact = module.getArtifact();
    if (!artifact.getName().equals(moduleName)) {
      throw new IllegalArgumentException("Ivy description of artifact has different module than the resolve artifact: " + moduleName);
    }

    if (!artifact.getVersion().plain().equals(revision)) {
      throw new IllegalArgumentException("Ivy description of artifact has different revision than the resolve artifact: " + revision);
    }
  }
View Full Code Here

      final String type = Xml.getAttribute(node, "type", "jar");
      final String ext = Xml.getAttribute(node, "ext", type);
      final String conf = Xml.getAttribute(node, "conf", defaultConf);
      // final String url = Xml.getAttribute(node, "url", type);

      final Artifact artifact = new Artifact(name, module.getArtifact().getVersion(), ext, null);

      final StringTokenizer tokenizer = new StringTokenizer(conf);
      while (tokenizer.hasMoreTokens()) {
        final String token = tokenizer.nextToken().trim();
View Full Code Here

  @Override
  public Artifact lookup(Transport transport, Group group, UnresolvedArtifact artifact) {
    if (!artifact.getVersionPattern().isDynamic()) {
      // The version isn't dynamic so it can be 'looked-up' directly
      final Version version = Version.fromString(artifact.getVersionPattern().getOriginal());
      return new Artifact(artifact.getName(), version, artifact.getExtension(), artifact.getClassifier());
    }

    try {
      Version latest = null;

      final URI directory = calculateSearchURI(group, artifact);
      for (URI uri : transport.list(directory)) {
        final String moduleVersion = lastPathElement(uri.getPath());
        final Matcher matcher = VERSION_PATTERN.matcher(moduleVersion);
        if (!matcher.matches()) {
          // invalid module link
          continue;
        }

        final Version version = Version.fromString(matcher.group(1));
        if (version.compareTo(latest) > 0) {
          latest = version;
        }
      }

      if (latest == null) {
        throw new IllegalArgumentException("Unable to find latest version");
      }

      return new Artifact(artifact.getName(), latest, artifact.getExtension(), artifact.getClassifier());

    } catch (URISyntaxException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    throw new UnsupportedOperationException("Not implemented");
  }

  protected URI calculateIvyURI(Module module) throws URISyntaxException {
    final Group group = module.getGroup();
    final Artifact artifact = module.getArtifact();
    final String path = ivyPattern.replaceAll(P_ORG, group.get()).replaceAll(P_MODULE, artifact.getName())
        .replaceAll(P_VERSION, artifact.getVersion().plain());
    return new URI(base + path);
  }
View Full Code Here

    URI base = new URI("http://ivy.dev.midasplayer.com/repository/");
    Transport transport = new HttpTransport();
    Repository repository = new IvyRepository(base, ivyPattern, artifactPattern);

    Group group = new Group("king");
    Artifact artifact = repository.lookup(transport, group, new UnresolvedArtifact("plataforma", new VersionPattern("0.193.5")));
    Assert.assertNotNull(artifact);

    System.out.println("Artifact: " + artifact);

    ResolveResult result = repository.resolve(transport, new Module(group, artifact));
View Full Code Here

TOP

Related Classes of org.dru.clay.respository.artifact.Artifact

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.