Package org.apache.ivy.core.module.id

Examples of org.apache.ivy.core.module.id.ModuleId


    public void testWithoutVersion() throws Exception {
        ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
            new IvySettings(), getClass().getResource("test-without-version.pom"), false);
        assertNotNull(md);

        assertEquals(new ModuleId("org.apache", "test"), md.getModuleRevisionId().getModuleId());

        DependencyDescriptor[] dds = md.getDependencies();
        assertNotNull(dds);
        assertEquals(1, dds.length);
        assertEquals(ModuleRevisionId.newInstance("commons-logging", "commons-logging", "1.0.4"),
View Full Code Here


    public List getModuleIds() {
        List ret = new ArrayList();
        List sortedDependencies = new ArrayList(dependencies);
        for (Iterator iter = sortedDependencies.iterator(); iter.hasNext();) {
            IvyNode dependency = (IvyNode) iter.next();
            ModuleId mid = dependency.getResolvedId().getModuleId();
            if (!ret.contains(mid)) {
                ret.add(mid);
            }
        }
        return ret;
View Full Code Here

        assertDependencyArtifactExcludeRules(dd, new String[] {"myconf3"},
            new String[] {"toexclude"});
        assertDependencyArtifactExcludeRules(dd, new String[] {"myconf4"},
            new String[] {"toexclude"});

        ConflictManager cm = md.getConflictManager(new ModuleId("yourorg", "yourmodule1"));
        assertNotNull(cm);
        assertTrue(cm instanceof NoConflictManager);

        cm = md.getConflictManager(new ModuleId("yourorg", "yourmodule2"));
        assertNotNull(cm);
        assertTrue(cm instanceof NoConflictManager);

        cm = md.getConflictManager(new ModuleId("theirorg", "theirmodule1"));
        assertNotNull(cm);
        assertTrue(cm instanceof FixedConflictManager);
        FixedConflictManager fcm = (FixedConflictManager) cm;
        assertEquals(2, fcm.getRevs().size());
        assertTrue(fcm.getRevs().contains("1.0"));
        assertTrue(fcm.getRevs().contains("1.1"));

        cm = md.getConflictManager(new ModuleId("theirorg", "theirmodule2"));
        assertNull(cm);

        ExcludeRule[] rules = md.getAllExcludeRules();
        assertNotNull(rules);
        assertEquals(2, rules.length);
View Full Code Here

                }
                if (module == null) {
                    throw new IllegalArgumentException(
                            "'name' is mandatory in module element: check your configuration");
                }
                ivy.addModuleConfiguration(new ModuleId(organisation, module), ivy
                        .getMatcher(matcher), resolver, branch, cm);
            }
        } catch (ParseException ex) {
            throw new SAXException("problem in config file: " + ex.getMessage(), ex);
        } catch (IOException ex) {
View Full Code Here

            DefaultModuleDescriptor md = new DefaultModuleDescriptor(ModuleRevisionId.newInstance(
                "apache", "ivy-install", "1.0"), settings.getStatusManager().getDefaultStatus(),
                    new Date());
            String resolveId = ResolveOptions.getDefaultResolveId(md);
            md.addConfiguration(new Configuration("default"));
            md.addConflictManager(new ModuleId(ExactPatternMatcher.ANY_EXPRESSION,
                    ExactPatternMatcher.ANY_EXPRESSION), ExactPatternMatcher.INSTANCE,
                new NoConflictManager());

            if (MatcherHelper.isExact(matcher, mrid)) {
                DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, mrid, false,
View Full Code Here

            if (orgMatcher.matches(orgs[i])) {
                tokenValues.put(IvyPatternHelper.ORGANISATION_KEY, orgs[i]);
                String[] mods = listTokenValues(IvyPatternHelper.MODULE_KEY, tokenValues);
                for (int j = 0; j < mods.length; j++) {
                    if (modMatcher.matches(mods[j])) {
                        ret.add(new ModuleId(orgs[i], mods[j]));
                    }
                }
            }
        }
        return (ModuleId[]) ret.toArray(new ModuleId[ret.size()]);
View Full Code Here

                    if (modMatcher.matches(mods[j])) {
                        tokenValues.put(IvyPatternHelper.MODULE_KEY, mods[j]);
                        String[] branches = listTokenValues(IvyPatternHelper.BRANCH_KEY,
                            tokenValues);
                        if (branches == null || branches.length == 0) {
                            branches = new String[] {settings.getDefaultBranch(new ModuleId(
                                    orgs[i], mods[j]))};
                        }
                        for (int k = 0; k < branches.length; k++) {
                            if (branches[k] == null || branchMatcher.matches(branches[k])) {
                                tokenValues.put(IvyPatternHelper.BRANCH_KEY, tokenValues);
View Full Code Here

                + " on " + resolverName);
        boolean foundModule = false;
        for (Iterator iter = modules.iterator(); iter.hasNext();) {
            ModuleEntry mEntry = (ModuleEntry) iter.next();

            ModuleId foundMid = new ModuleId(mEntry.getOrganisation(), mEntry.getModule());
            ModuleId systemMid = foundMid;
            if (fromNamespace != null) {
                systemMid = NameSpaceHelper.transform(foundMid, fromNamespace
                        .getToSystemTransformer());
            }
View Full Code Here

     * file does not exist for any conf (resolve has not been called before ?) then an
     * IllegalStateException is thrown and nothing is copied.
     */
    public int retrieve(ModuleRevisionId mrid, String destFilePattern, RetrieveOptions options)
            throws IOException {
        ModuleId moduleId = mrid.getModuleId();
        Message.info(":: retrieving :: " + moduleId + (options.isSync() ? " [sync]" : ""));
        Message.verbose("\tcheckUpToDate=" + settings.isCheckUpToDate());
        long start = System.currentTimeMillis();

        destFilePattern = IvyPatternHelper.substituteVariables(destFilePattern, settings
View Full Code Here

        }
    }

    public Map determineArtifactsToCopy(ModuleRevisionId mrid, String destFilePattern,
            RetrieveOptions options) throws ParseException, IOException {
        ModuleId moduleId = mrid.getModuleId();

        if (options.getResolveId() == null) {
            options.setResolveId(ResolveOptions.getDefaultResolveId(moduleId));
        }
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.module.id.ModuleId

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.