Java Code Examples for org.apache.ivy.core.resolve.IvyNode#hasProblem()
The following examples show how to use
org.apache.ivy.core.resolve.IvyNode#hasProblem() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IvyInternalDepResolver.java From jeka with Apache License 2.0 | 6 votes |
private List<JkModuleDepProblem> moduleProblems(List<IvyNode> ivyNodes) { final List<JkModuleDepProblem> result = new LinkedList<>(); for (final IvyNode ivyNode : ivyNodes) { if (ivyNode.isCompletelyBlacklisted() || ivyNode.isCompletelyEvicted()) { continue; } if (ivyNode.hasProblem()) { final JkModuleId jkModuleId = JkModuleId.of(ivyNode.getModuleId().getOrganisation(), ivyNode.getModuleId().getName()); final JkModuleDepProblem problem = JkModuleDepProblem.of(jkModuleId, ivyNode.getId().getRevision(), ivyNode.getProblemMessage()); result.add(problem); } } return result; }
Example 2
Source File: ResolveReport.java From ant-ivy with Apache License 2.0 | 6 votes |
public void setDependencies(List<IvyNode> dependencies, Filter<Artifact> artifactFilter) { this.dependencies = dependencies; // collect list of artifacts artifacts = new ArrayList<>(); for (IvyNode dependency : dependencies) { if (!dependency.isCompletelyEvicted() && !dependency.hasProblem()) { artifacts.addAll(Arrays.asList(dependency.getSelectedArtifacts(artifactFilter))); } // update the configurations reports with the dependencies // these reports will be completed later with download information, if any for (String dconf : dependency.getRootModuleConfigurations()) { ConfigurationResolveReport configurationReport = getConfigurationReport(dconf); if (configurationReport != null) { configurationReport.addDependency(dependency); } } } }
Example 3
Source File: ConfigurationResolveReport.java From ant-ivy with Apache License 2.0 | 5 votes |
/** * Returns all non evicted and non error dependency mrids The returned set is ordered so that a * dependency will always be found before their own dependencies * * @return all non evicted and non error dependency mrids */ public Set<ModuleRevisionId> getModuleRevisionIds() { Set<ModuleRevisionId> mrids = new LinkedHashSet<>(); for (IvyNode node : getDependencies()) { if (!node.isEvicted(getConfiguration()) && !node.hasProblem()) { mrids.add(node.getResolvedId()); } } return mrids; }
Example 4
Source File: ConfigurationResolveReport.java From ant-ivy with Apache License 2.0 | 5 votes |
public IvyNode[] getUnresolvedDependencies() { List<IvyNode> unresolved = new ArrayList<>(); for (IvyNode node : getDependencies()) { if (node.hasProblem()) { unresolved.add(node); } } return unresolved.toArray(new IvyNode[unresolved.size()]); }
Example 5
Source File: XmlReportWriter.java From ant-ivy with Apache License 2.0 | 4 votes |
private void outputRevision(ConfigurationResolveReport report, PrintWriter out, List<ModuleRevisionId> dependencies, IvyNode dep) { Map<String, String> extraAttributes; ModuleDescriptor md = null; if (dep.getModuleRevision() != null) { md = dep.getModuleRevision().getDescriptor(); } StringBuilder details = new StringBuilder(); if (dep.isLoaded()) { details.append(" status=\""); details.append(XMLHelper.escape(dep.getDescriptor().getStatus())); details.append("\" pubdate=\""); details.append(DateUtil.format(new Date(dep.getPublication()))); details.append("\" resolver=\""); details.append(XMLHelper.escape(dep.getModuleRevision().getResolver().getName())); details.append("\" artresolver=\""); details.append(XMLHelper .escape(dep.getModuleRevision().getArtifactResolver().getName())); details.append("\""); } if (dep.isEvicted(report.getConfiguration())) { EvictionData ed = dep.getEvictedData(report.getConfiguration()); if (ed.getConflictManager() != null) { details.append(" evicted=\"") .append(XMLHelper.escape(ed.getConflictManager().toString())).append("\""); } else { details.append(" evicted=\"transitive\""); } details.append(" evicted-reason=\"") .append(XMLHelper.escape(ed.getDetail() == null ? "" : ed.getDetail())) .append("\""); } if (dep.hasProblem()) { details.append(" error=\"").append(XMLHelper.escape(dep.getProblem().getMessage())) .append("\""); } if (md != null && md.getHomePage() != null) { details.append(" homepage=\"").append(XMLHelper.escape(md.getHomePage())).append("\""); } extraAttributes = (md != null) ? md.getQualifiedExtraAttributes() : dep.getResolvedId().getQualifiedExtraAttributes(); details.append(extraToString(extraAttributes, SEPARATOR)); out.println(String.format("\t\t\t<revision name=\"%s\"%s%s downloaded=\"%s\" searched=\"%s\"%s conf=\"%s\" position=\"%d\">", XMLHelper.escape(dep.getResolvedId().getRevision()), (dep.getResolvedId().getBranch() == null) ? "" : " branch=\"" + XMLHelper.escape(dep.getResolvedId().getBranch()) + "\"", details, dep.isDownloaded(), dep.isSearched(), (dep.getDescriptor() == null) ? "" : " default=\"" + dep.getDescriptor().isDefault() + "\"", XMLHelper.escape(joinArray(dep.getConfigurations(report.getConfiguration()), ", ")), dependencies.indexOf(dep.getResolvedId()))); if (md != null) { License[] licenses = md.getLicenses(); for (License license : licenses) { out.println(String.format("\t\t\t\t<license name=\"%s\"%s/>", XMLHelper.escape(license.getName()), license.getUrl() == null ? "" : " url=\"" + XMLHelper.escape(license.getUrl()) + "\"")); } } outputMetadataArtifact(out, dep); outputEvictionInformation(report, out, dep); outputCallers(report, out, dep); outputArtifacts(report, out, dep); out.println("\t\t\t</revision>"); }