Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-965

Support useOrigin for artifacts with a set url attribute

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-RC1
    • 2.0
    • Core
    • None

    Description

      Currently artifacts with a specified url are always considered remote because the code instantiates URLResource.
      This change would allow using FileResource when the url is "file://*".

      --- BasicResolver.java.original        Mon Oct 20 16:47:15 2008
      +++ BasicResolver.java  Mon Nov 03 15:38:48 2008
      @@ -64,6 +64,8 @@
       import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
       import org.apache.ivy.plugins.repository.Resource;
       import org.apache.ivy.plugins.repository.ResourceDownloader;
      +import org.apache.ivy.plugins.repository.file.FileRepository;
      +import org.apache.ivy.plugins.repository.file.FileResource;
       import org.apache.ivy.plugins.repository.url.URLRepository;
       import org.apache.ivy.plugins.repository.url.URLResource;
       import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
      @@ -918,7 +920,14 @@
                       URL url = artifact.getUrl();
                       Message.verbose("\tusing url for " + artifact + ": " + url);
                       logArtifactAttempt(artifact, url.toExternalForm());
      -                ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
      +                Resource resource;
      +                if ("file".equals(url.getProtocol())) {
      +                       resource = new FileResource(new FileRepository(), new File(url.getPath()));
      +                }
      +                else {
      +                       resource = new URLResource(url);
      +                }
      +                               ret = new ResolvedResource(resource, artifact.getModuleRevisionId()
                               .getRevision());
                   }
                   return ret;
      

      Attachments

        Activity

          People

            maartenc Maarten Coene
            alex322 alex322
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: