Package org.dru.clay.respository.artifact

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


  @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) {
View Full Code Here

TOP

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

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.