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.getExtraAttributes() : dep.getResolvedId()
.getExtraAttributes();
for (Iterator iterator = extraAttributes.keySet().iterator(); iterator.hasNext();) {
String attName = (String) iterator.next();
details.append(" extra-").append(attName).append("=\"").append(
XMLHelper.escape(extraAttributes.get(attName).toString())).append("\"");
}
String defaultValue = dep.getDescriptor() != null ? " default=\""
+ dep.getDescriptor().isDefault() + "\"" : "";
int position = dependencies.indexOf(dep.getResolvedId());
out.println("\t\t\t<revision name=\""
+ XMLHelper.escape(dep.getResolvedId().getRevision())
+ "\""
+ (dep.getResolvedId().getBranch() == null ? "" : " branch=\""
+ XMLHelper.escape(
dep.getResolvedId().getBranch()) + "\"") + details
+ " downloaded=\"" + dep.isDownloaded() + "\"" + " searched=\""
+ dep.isSearched() + "\"" + defaultValue + " conf=\""
+ toString(dep.getConfigurations(report.getConfiguration())) + "\""
+ " position=\"" + position + "\">");
if (md != null) {
License[] licenses = md.getLicenses();
for (int i = 0; i < licenses.length; i++) {
String lurl;
if (licenses[i].getUrl() != null) {
lurl = " url=\"" + XMLHelper.escape(licenses[i].getUrl()) + "\"";
} else {
lurl = "";
}
out.println("\t\t\t\t<license name=\""
+ XMLHelper.escape(licenses[i].getName()) + "\""
+ lurl + "/>");
}
}
if (dep.getModuleRevision() != null) {
MetadataArtifactDownloadReport madr = dep.getModuleRevision().getReport();
out.print("\t\t\t\t<metadata-artifact");
out.print(" status=\""
+ XMLHelper.escape(madr.getDownloadStatus().toString()) + "\"");
out.print(" details=\"" + XMLHelper.escape(madr.getDownloadDetails()) + "\"");
out.print(" size=\"" + madr.getSize() + "\"");
out.print(" time=\"" + madr.getDownloadTimeMillis() + "\"");
if (madr.getLocalFile() != null) {
out.print(" location=\""
+ XMLHelper.escape(madr.getLocalFile().getAbsolutePath()) + "\"");
}
out.print(" searched=\"" + madr.isSearched() + "\"");
if (madr.getOriginalLocalFile() != null) {
out.print(" original-local-location=\""
+ XMLHelper.escape(madr.getOriginalLocalFile().getAbsolutePath()) + "\"");
}
ArtifactOrigin origin = madr.getArtifactOrigin();
if (origin != null) {
out.print(" origin-is-local=\"" + String.valueOf(origin.isLocal()) + "\"");
out.print(" origin-location=\"" + XMLHelper.escape(origin.getLocation()) + "\"");
}
out.println("/>");
}
if (dep.isEvicted(report.getConfiguration())) {
EvictionData ed = dep.getEvictedData(report.getConfiguration());
Collection selected = ed.getSelected();
if (selected != null) {
for (Iterator it3 = selected.iterator(); it3.hasNext();) {
IvyNode sel = (IvyNode) it3.next();
out.println("\t\t\t\t<evicted-by rev=\""
+ XMLHelper.escape(sel.getResolvedId().getRevision()) + "\"/>");