Package org.apache.ivy.plugins.report

Examples of org.apache.ivy.plugins.report.XmlReportParser$SaxXmlReportParser$XmlReportParserHandler


      List urls = new ArrayList();
     
        try {
            Collection all = new LinkedHashSet();
            CacheManager cacheMgr = ivy.getCacheManager(cache);
            XmlReportParser parser = new XmlReportParser();
            for (int i = 0; i < confs.length; i++) {
              String resolveId = ResolveOptions.getDefaultResolveId(md);
              File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
              parser.parse(report);
             
                Artifact[] artifacts = parser.getArtifacts();
                all.addAll(Arrays.asList(artifacts));
            }
            for (Iterator iter = all.iterator(); iter.hasNext();) {
                Artifact artifact = (Artifact)iter.next();
               
View Full Code Here


      CacheManager cache = options.getCache();
      String resolveId = options.getResolveId();
        File previousReportFile = cache.getConfigurationResolveReportInCache(resolveId, conf);
    if (previousReportFile.exists()) {
      try {
        XmlReportParser parser = new XmlReportParser();
        parser.parse(previousReportFile);
        _previousDeps = Arrays.asList(parser.getDependencyRevisionIds());
      } catch (Exception e) {
        Message.warn("Error while parsing configuration resolve report " + previousReportFile.getAbsolutePath());
        e.printStackTrace();
        _previousDeps = null;
      }
View Full Code Here

                }
            }
        } else {
            Message.debug("using stored report to get artifacts list");
           
            XmlReportParser parser = new XmlReportParser();
            CacheManager cacheMgr = getIvyInstance().getCacheManager(getCache());
            for (int i = 0; i < confs.length; i++) {
              File reportFile = cacheMgr.getConfigurationResolveReportInCache(getResolveId(), confs[i]);
              parser.parse(reportFile);
             
                Artifact[] artifacts = parser.getArtifacts();
                all.addAll(Arrays.asList(artifacts));
            }
        }
        return all;
    }
View Full Code Here

      }
      File[] files = options.getCache().getConfigurationResolveReportsInCache(resolveId);
      if (files.length == 0) {
            throw new IllegalStateException("No previous resolve found for id '" + resolveId + "' Please resolve dependencies before delivering.");
      }
      XmlReportParser parser = new XmlReportParser();
      parser.parse(files[0]);
      ModuleRevisionId mrid = parser.getResolvedModule();
      deliver(mrid, revision, destIvyPattern, options);
    }
View Full Code Here

            String[] confs = splitConfs(getConf());
            String resolveId = getResolveId();
            if (resolveId == null) {
              resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
            }
            XmlReportParser parser = new XmlReportParser();
            for (int i = 0; i < confs.length; i++) {
              File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
              parser.parse(report);
             
                Artifact[] artifacts = parser.getArtifacts();
                for (int j = 0; j < artifacts.length; j++) {
                    Artifact artifact = artifacts[j];
                    String name = IvyPatternHelper.substitute(getSettings().substitute(getName()), artifact, confs[i]);
                    String value = IvyPatternHelper.substitute(getSettings().substitute(getValue()), artifact, confs[i]);
                    getProject().setProperty(name, value);
View Full Code Here

        try {
            String pathSeparator = System.getProperty("path.separator");
            StringBuffer buf = new StringBuffer();
            Collection all = new LinkedHashSet();
            ResolutionCacheManager cacheMgr = ivy.getResolutionCacheManager();
            XmlReportParser parser = new XmlReportParser();
            for (int i = 0; i < confs.length; i++) {
                String resolveId = ResolveOptions.getDefaultResolveId(md);
                File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
                parser.parse(report);

                all.addAll(Arrays.asList(parser.getArtifactReports()));
            }
            for (Iterator iter = all.iterator(); iter.hasNext();) {
                ArtifactDownloadReport artifact = (ArtifactDownloadReport) iter.next();
                if (artifact.getLocalFile() != null) {
                    buf.append(artifact.getLocalFile().getCanonicalPath());
View Full Code Here

        }
       
        try {
            Collection all = new LinkedHashSet();
            ResolutionCacheManager cacheMgr = ivy.getResolutionCacheManager();
            XmlReportParser parser = new XmlReportParser();
            for (int i = 0; i < confs.length; i++) {
                String resolveId = ResolveOptions.getDefaultResolveId(md);
                File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
                parser.parse(report);

                all.addAll(Arrays.asList(parser.getArtifactReports()));
            }
            for (Iterator iter = all.iterator(); iter.hasNext();) {
                ArtifactDownloadReport artifact = (ArtifactDownloadReport) iter.next();

                if (artifact.getLocalFile() != null) {
View Full Code Here

                ResolveOptions.getDefaultResolveId(md), confs[i]);
            parsingOk = false;
            if (report.exists()) {
                // found a report, try to parse it.
                try {
                    XmlReportParser parser = new XmlReportParser();
                    parser.parse(report);
                    all.addAll(Arrays.asList(parser.getArtifactReports()));
                    parsingOk = true;
                    findAllArtifactOnRefresh(parser);
                } catch (ParseException e) {
                    Message.info("\n\nIVYDE: Error while parsing the report " + report
                            + ". Falling back by doing a resolve again.");
View Full Code Here

            List<ModuleDescriptor> dependencies = new ArrayList<ModuleDescriptor>();

            // first, let's resolve the ant scripts, just the scripts, not their possible jar dependencies, thus only
            // the configuration "default"

            XmlReportParser xmlreport = null;
            if (!refresh) {
                // first try to relad the resolve from the last report
                xmlreport = getResolveReport(ivy, md.getModuleRevisionId().getModuleId(), "default", ivyfile);
            }
            if (xmlreport != null) {
                // collect the ant scripts
                artifacts = xmlreport.getArtifactReports();

                // collect the descriptor associated with each ant script
                ModuleRevisionId[] depIds = xmlreport.getDependencyRevisionIds();
                for (int i = 0; i < depIds.length; i++) {
                    File depIvyFile = xmlreport.getMetadataArtifactReport(depIds[i]).getLocalFile();
                    dependencies.add(getMd(ivy, depIvyFile));
                }
            } else {
                // do a full resolve

                // if in a retrieved setup, clean the repo and repopulate it
                maybeClearLocalRepo();
                maybeRetrieve(md, "default");

                // launch the actual resolve
                ResolveReport resolveReport = resolve(ivy, md, "default");
                ConfigurationResolveReport confReport = resolveReport.getConfigurationReport("default");

                // collect the ant scripts
                artifacts = confReport.getAllArtifactsReports();

                // collect the descriptor associated with each ant script
                Set<ModuleRevisionId> mrids = confReport.getModuleRevisionIds();
                for (ModuleRevisionId mrid : mrids) {
                    dependencies.add(confReport.getDependency(mrid).getDescriptor());
                }
            }

            int nbPaths = 1;

            // save the collection of ant scripts as a path
            Path antScriptsPath = makePath("easyant.antscripts", sortArtifacts(ivy, artifacts, dependencies));

            // now, for each ant script descriptor, search for an ivy configuration which is used by the ant script
            // itself

            for (ModuleDescriptor depmd : dependencies) {
                log("Searching for external conf for " + depmd.getModuleRevisionId(), Project.MSG_VERBOSE);
                String[] confs = depmd.getConfigurationsNames();
                log("configurations for " + depmd.getModuleRevisionId() + " : " + Arrays.toString(confs),
                        Project.MSG_DEBUG);

                // some trick here: launching a resolve on a module won't resolve the artifacts of the module itself but
                // only of its dependencies. So we'll create a mock one which will depend on the real one
                String mockOrg = "_easyant_mocks_";
                String mockName = depmd.getModuleRevisionId().getOrganisation() + "__"
                        + depmd.getModuleRevisionId().getName();
                ModuleRevisionId mockmrid = ModuleRevisionId.newInstance(mockOrg, mockName, depmd.getModuleRevisionId()
                        .getBranch(), depmd.getRevision(), depmd.getExtraAttributes());
                DefaultModuleDescriptor mock = new DefaultModuleDescriptor(mockmrid, depmd.getStatus(),
                        depmd.getPublicationDate(), depmd.isDefault());
                DefaultDependencyDescriptor mockdd = new DefaultDependencyDescriptor(depmd.getModuleRevisionId(), false);
                for (String conf : confs) {
                    mock.addConfiguration(new Configuration(conf));
                    mockdd.addDependencyConfiguration(conf, conf);
                }
                mock.addDependency(mockdd);

                for (String conf : confs) {
                    if (conf.equals("default")) {
                        continue;
                    }

                    nbPaths++;
                    log("Found configuration " + conf, Project.MSG_VERBOSE);

                    // same process than for the ant script:
                    // * trust the last resolve report
                    // * or launch a full resolve
                    // A full resolve might trigger a retrieve to populate the local repo

                    XmlReportParser xmldepreport = null;
                    if (!refresh) {
                        xmldepreport = getResolveReport(ivy, mock.getModuleRevisionId().getModuleId(), conf, null);
                    }
                    if (xmldepreport != null) {
                        artifacts = xmldepreport.getArtifactReports();
                    } else {
                        maybeRetrieve(mock, conf);
                        ResolveReport resolveReport = resolve(ivy, mock, conf);
                        ConfigurationResolveReport confReport = resolveReport.getConfigurationReport(conf);
                        artifacts = confReport.getAllArtifactsReports();
View Full Code Here

            return null;
        }
        // found a report, try to parse it.
        try {
            log("Reading resolve report " + report, Project.MSG_DEBUG);
            XmlReportParser reportparser = new XmlReportParser();
            reportparser.parse(report);
            if (reportparser.hasError()) {
                return null;
            }
            log("Loading last resolve report for " + mid + "[" + conf + "]", Project.MSG_VERBOSE);
            return reportparser;
        } catch (ParseException e) {
View Full Code Here

TOP

Related Classes of org.apache.ivy.plugins.report.XmlReportParser$SaxXmlReportParser$XmlReportParserHandler

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.