protected void extendsStarted()

in src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java [732:789]


        protected void extendsStarted(Attributes attributes) throws ParseException {
            String parentOrganisation = getSettings().substitute(attributes.getValue("organisation"));
            String parentModule = getSettings().substitute(attributes.getValue("module"));
            String parentRevision = attributes.getValue("revision") != null ? getSettings().substitute(
                    attributes.getValue("revision")) : Ivy.getWorkingRevision();
            String location = attributes.getValue("location") != null ? getSettings().substitute(
                    attributes.getValue("location")) : getDefaultParentLocation();
            ModuleDescriptor parent = null;

            String extendType = attributes.getValue("extendType") != null ? getSettings().substitute(
                    attributes.getValue("extendType").toLowerCase(Locale.US)) : "all";

            List<String> extendTypes = Arrays.asList(extendType.split(","));
            ModuleId parentMid = new ModuleId(parentOrganisation, parentModule);
            ModuleRevisionId parentMrid = new ModuleRevisionId(parentMid, parentRevision);

            // check on filesystem based on location attribute (for dev ONLY)
            boolean local = false;
            try {
                parent = parseParentModuleOnFilesystem(location);
                if (parent != null) {
                    ModuleId foundMid = parent.getResolvedModuleRevisionId().getModuleId();
                    if (!foundMid.equals(parentMid)) {
                        // the filesystem contains a parent module with different organisation
                        // or module name; ignore that parent module
                        Message.info("Found a parent module with unexpected ModuleRevisionId at source location "
                                + location + "! Expected: " + parentMid + ". Found: " + foundMid
                                + ". This parent module will be ignored.");
                        parent = null;
                    }
                }

                local = parent != null;
            } catch (IOException e) {
                Message.warn("Unable to parse included ivy file " + location + " : " + e.getMessage());
            }

            // if not found, tries to resolve using repositories
            if (parent == null) {
                try {
                    parent = parseOtherIvyFile(parentMrid);
                } catch (ParseException e) {
                    Message.warn("Unable to parse included ivy file for " + parentMrid.toString() + " : "
                            + e.getMessage());
                }
            }

            // if still not found throw an exception
            if (parent == null) {
                throw new ParseException("Unable to parse included ivy file for " + parentMrid.toString(), 0);
            }

            DefaultExtendsDescriptor ed = new DefaultExtendsDescriptor(parent, location,
                    extendTypes.toArray(new String[extendTypes.size()]), local);
            getMd().addInheritedDescriptor(ed);

            mergeWithOtherModuleDescriptor(extendTypes, parent);
        }