Package org.apache.ivy.core.resolve

Examples of org.apache.ivy.core.resolve.ResolvedModuleRevision


                }

                if (branch == null) {
                    settings.getDefaultBranch(new ModuleId(organisation, module));
                }
                ResolvedModuleRevision rmr = ivy.findModule(ModuleRevisionId.newInstance(
                    organisation, module, branch, revision));
                if (rmr != null) {
                    ModuleDescriptor md = rmr.getDescriptor();
                    ModuleRevisionId mrid = rmr.getId();
                    setProperties(md, mrid);
                }
            } else {
                if (file == null) {
                    file = getProject().resolveFile(getProperty(settings, "ivy.dep.file"));
View Full Code Here


        int i = 0;
        for (ModuleDescriptor md : mds) {
            MetadataArtifactDownloadReport report = new MetadataArtifactDownloadReport(null);
            report.setDownloadStatus(DownloadStatus.NO);
            report.setSearched(true);
            ResolvedModuleRevision rmr = new ResolvedModuleRevision(this, this, md, report);
            MDResolvedResource mdrr = new MDResolvedResource(null, md.getRevision(), rmr);
            ret[i++] = mdrr;
        }
        return ret;
    }
View Full Code Here

        capabilityMd.addDependency(capabilityDD);

        MetadataArtifactDownloadReport report = new MetadataArtifactDownloadReport(null);
        report.setDownloadStatus(DownloadStatus.NO);
        report.setSearched(true);
        ResolvedModuleRevision rmr = new ResolvedModuleRevision(this, this, capabilityMd, report);
        return new MDResolvedResource(null, capabilityMd.getRevision(), rmr);
    }
View Full Code Here

                    }
                    revision = revisions[indexRevision++];
                    mrid = ModuleRevisionId.newInstance(organisation.getOrganisation(),
                        module.getModule(), revision.getRevision());
                    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(mrid, false);
                    ResolvedModuleRevision dependency;
                    try {
                        dependency = resolver.getDependency(dd, data);
                    } catch (ParseException e) {
                        Message.error("Error while resolving " + mrid + " : " + e.getMessage());
                        revision = null;
                        continue;
                    }
                    if (dependency == null) {
                        revision = null;
                        continue;
                    }
                    ModuleDescriptor md = dependency.getDescriptor();
                    mrid = md.getModuleRevisionId();
                    artifacts = md.getAllArtifacts();
                    indexArtifact = 0;
                    artifact = null;
                }
View Full Code Here

        resolveAndAssertFound(settings, resolver, "#A;1.0");
    }

    private void resolveAndAssertNotFound(IvySettings settings, FileSystemResolver resolver,
            String module, String context) throws ParseException {
        ResolvedModuleRevision rmr = resolveModule(settings, resolver, module);
        assertNull("module found " + context + ". module=" + rmr, rmr);
    }
View Full Code Here

        assertNull("module found " + context + ". module=" + rmr, rmr);
    }

    private void resolveAndAssertFound(IvySettings settings, FileSystemResolver resolver,
            String module) throws ParseException {
        ResolvedModuleRevision rmr = resolveModule(settings, resolver, module);
        assertNotNull(rmr);
        assertEquals(module, rmr.getId().toString());
    }
View Full Code Here

            throws ParseException {
        if (ivyResolver == null || artifactResolver == null) {
            throw new IllegalStateException(
                    "exactly two resolvers must be added: ivy(1) and artifact(2) one");
        }
        ResolvedModuleRevision resolved = data.getCurrentResolvedModuleRevision();

        data = new ResolveData(data, doValidate(data));
        final ResolvedModuleRevision mr = ivyResolver.getDependency(dd, data);
        if (mr == null) {
            checkInterrupted();
            if (isAllownomd()) {
                Message.verbose("ivy resolver didn't find " + dd
                        + ": trying with artifact resolver");
                return artifactResolver.getDependency(dd, data);
            } else {
                return null;
            }
        } else {
            if (mr == resolved) {
                // nothing has actually been resolved here, we don't need to touch the returned rmr
                return mr;
            }
            return new ResolvedModuleRevision(mr.getResolver(), this, mr.getDescriptor(),
                    mr.getReport(), mr.isForce());
        }
    }
View Full Code Here

                + "/[organisation]/[module]/[type]s/[artifact]-[revision].[type]");
        resolver.setName("test");
        assertEquals("test", resolver.getName());

        ModuleRevisionId mrid = ModuleRevisionId.newInstance("org1", "mod1.1", "1.0");
        ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(mrid,
                false), data);
        assertNotNull(rmr);

        assertEquals(mrid, rmr.getId());
        Date pubdate = new GregorianCalendar(2004, 10, 1, 11, 0, 0).getTime();
        assertEquals(pubdate, rmr.getPublicationDate());

        // test to ask to download
        DefaultArtifact artifact = new DefaultArtifact(mrid, pubdate, "mod1.1", "jar", "jar");
        DownloadReport report = resolver.download(new Artifact[] {artifact}, downloadOptions());
        assertNotNull(report);
View Full Code Here

                + "[organisation]/[module]/[type]s/[artifact]-[revision].[type]");
        resolver.setName("test");
        assertEquals("test", resolver.getName());

        ModuleRevisionId mrid = ModuleRevisionId.newInstance("org1", "mod1.1", "2.0");
        ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(
                ModuleRevisionId.newInstance("org1", "mod1.1", "latest.integration"), false), data);
        assertNotNull(rmr);

        assertEquals(mrid, rmr.getId());
        Date pubdate = new GregorianCalendar(2005, 1, 15, 11, 0, 0).getTime();
        assertEquals(pubdate, rmr.getPublicationDate());
    }
View Full Code Here

                + "/[organisation]/[module]/[type]s/[artifact]-[revision].[type]");
        resolver.setName("test");
        assertEquals("test", resolver.getName());

        ModuleRevisionId mrid = ModuleRevisionId.newInstance("org1", "mod1.1", "2.0");
        ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(
                ModuleRevisionId.newInstance("org1", "mod1.1", "latest.integration"), false), data);
        assertNotNull(rmr);

        assertEquals(mrid, rmr.getId());
        Date pubdate = new GregorianCalendar(2005, 1, 15, 11, 0, 0).getTime();
        assertEquals(pubdate, rmr.getPublicationDate());
    }
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.resolve.ResolvedModuleRevision

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.