Package org.apache.ivy.core.retrieve

Examples of org.apache.ivy.core.retrieve.RetrieveOptions


  public int retrieve(ModuleId moduleId, String[] confs, File cache, String destFilePattern) {
    try {
      return _ivy.retrieve(
          new ModuleRevisionId(moduleId, Ivy.getWorkingRevision()),
          destFilePattern,
          new RetrieveOptions()
            .setConfs(confs)
            .setCache(CacheManager.getInstance(_ivy.getSettings(), cache)));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
View Full Code Here


        try {
          Filter artifactFilter = getArtifactFilter();
            int targetsCopied = getIvyInstance().retrieve(
                getResolvedMrid(),
                _pattern,
                new RetrieveOptions()
                  .setConfs(splitConfs(getConf()))
                  .setCache(CacheManager.getInstance(getIvyInstance().getSettings(), getCache()))
                  .setDestIvyPattern(_ivypattern)
                  .setArtifactFilter(artifactFilter)
                  .setSync(_sync)
View Full Code Here

                  null);

            Map artifactsToCopy = getIvyInstance().getRetrieveEngine().determineArtifactsToCopy(
                ModuleRevisionId.newInstance(getOrganisation(), getModule(), getRevision()),
                _pattern,
                new RetrieveOptions()
                  .setConfs(confs)
                  .setResolveId(getResolveId())
                  .setCache(cacheManager));
           
            Map moduleRevToArtifactsMap = new HashMap();
View Full Code Here

            if (line.hasOption("retrieve")) {
                String retrievePattern = settings.substitute(line.getOptionValue("retrieve"));
                if (retrievePattern.indexOf("[") == -1) {
                    retrievePattern = retrievePattern + "/lib/[conf]/[artifact].[ext]";
                }
                ivy.retrieve(md.getModuleRevisionId(), retrievePattern, new RetrieveOptions()
                        .setConfs(confs).setSync(line.hasOption("sync"))
                        .setUseOrigin(line.hasOption("useOrigin")));
            }
            if (line.hasOption("cachepath")) {
                outputCachePath(ivy, cache, md, confs, line.getOptionValue("cachepath",
View Full Code Here

        String relativePath = PropertyUtils.relativizeFile(retrieveRootFile, retrievedFile);
        return LibrariesSupport.convertFilePathToURI(relativePath);
    }

    private void retrieveFiles(String[] confs, Ivy ivy, String retrieveRoot, ResolveReport report, Collection<String> acceptedTypes) throws IOException {
        RetrieveOptions retrieveOptions = new RetrieveOptions().setConfs(confs).setSync(true);
        Filter af = new ArtifactTypeFilter(acceptedTypes);
        retrieveOptions.setArtifactFilter(af);
        String projectRetrievePattern = retrieveRoot + RETRIEVE_PATTERN;
        ivy.retrieve(report.getModuleDescriptor().getResolvedModuleRevisionId(), projectRetrievePattern, retrieveOptions);
    }
View Full Code Here

            return;
        }
        String pattern = conf.getJavaProject().getProject().getLocation().toPortableString() + "/"
                + conf.getInheritedRetrievePattern();
        monitor.setTaskName("retrieving dependencies in " + pattern);
        RetrieveOptions c = new RetrieveOptions();
        c.setSync(conf.getInheritedRetrieveSync());
        c.setConfs(conf.getInheritedRetrieveConfs().split(","));
        String inheritedRetrieveTypes = conf.getInheritedRetrieveTypes();
        if (inheritedRetrieveTypes != null && !inheritedRetrieveTypes.equals("*")) {
            c.setArtifactFilter(new ArtifactTypeFilter(IvyClasspathUtil
                    .split(inheritedRetrieveTypes)));
        }
        ivy.retrieve(md.getModuleRevisionId(), pattern, c);
    }
View Full Code Here

        } catch (IOException e) {
            throw new BuildException("Unable to compute the path to the local repository", e);
        }
        ResolveReport resolve = resolve(ivy, md, conf);

        RetrieveOptions options = new RetrieveOptions();
        options.setSync(false);
        options.setResolveId(resolve.getResolveId());
        options.setConfs(new String[] { conf });
        options.setDestIvyPattern("${easyant.localrepo.basedir}/[organization]/[module]/[revision]/ivy.xml");
        try {
            ivy.retrieve(md.getModuleRevisionId(),
                    "${easyant.localrepo.basedir}/[organization]/[module]/[revision]/[type]s/[artifact].[ext]", options);
        } catch (IOException e) {
            throw new BuildException("Unable to build the local repository", e);
View Full Code Here

            if (line.hasOption("retrieve")) {
                String retrievePattern = settings.substitute(line.getOptionValue("retrieve"));
                if (retrievePattern.indexOf("[") == -1) {
                    retrievePattern = retrievePattern + "/lib/[conf]/[artifact].[ext]";
                }
                ivy.retrieve(md.getModuleRevisionId(), retrievePattern, new RetrieveOptions()
                        .setConfs(confs).setSync(line.hasOption("sync"))
                        .setUseOrigin(line.hasOption("useOrigin")));
            }
            if (line.hasOption("cachepath")) {
                outputCachePath(ivy, cache, md, confs, line.getOptionValue("cachepath",
View Full Code Here

            String destFilePattern, String destIvyPattern, Filter artifactFilter)
            throws ParseException, IOException {
        return ivy.getRetrieveEngine().determineArtifactsToCopy(
            new ModuleRevisionId(moduleId, Ivy.getWorkingRevision()),
            destFilePattern,
            new RetrieveOptions().setConfs(confs).setDestIvyPattern(
                destIvyPattern).setArtifactFilter(artifactFilter));
    }
View Full Code Here

    public Map determineArtifactsToCopy(ModuleId moduleId, String[] confs, File cache,
            String destFilePattern, String destIvyPattern) throws ParseException, IOException {
        return ivy.getRetrieveEngine().determineArtifactsToCopy(
            new ModuleRevisionId(moduleId, Ivy.getWorkingRevision()),
            destFilePattern,
            new RetrieveOptions().setConfs(confs).setDestIvyPattern(
                destIvyPattern));
    }
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.retrieve.RetrieveOptions

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.