private void displayDependencyUpdates(ResolveReport originalReport, ResolveReport latestReport) {
log("Dependencies updates available :");
boolean dependencyUpdateDetected = false;
for (Iterator iterator = latestReport.getDependencies().iterator(); iterator.hasNext();) {
IvyNode latest = (IvyNode) iterator.next();
for (Iterator iterator2 = originalReport.getDependencies().iterator(); iterator2
.hasNext();) {
IvyNode originalDependency = (IvyNode) iterator2.next();
if (originalDependency.getModuleId().equals(latest.getModuleId())) {
if (!originalDependency.getResolvedId().getRevision()
.equals(latest.getResolvedId().getRevision())) {
// is this dependency a transitive dependency ? or direct dependency
// (unfortunatly
// .isTranstive() methods doesn't have the same meaning)
boolean isTransitiveDependency = latest.getDependencyDescriptor(latest
.getRoot()) == null;
if ((!isTransitiveDependency) || (isTransitiveDependency && showTransitive)) {
StringBuffer sb = new StringBuffer();
sb.append("\t")//
.append(originalDependency.getResolvedId().getOrganisation()) //
.append('#')//
.append(originalDependency.getResolvedId().getName())//
.append(isTransitiveDependency ? " (transitive)" : "") //
.append("\t")//
.append(originalDependency.getResolvedId().getRevision())//
.append(" -> ")//
.append(latest.getResolvedId().getRevision());
log(sb.toString());
dependencyUpdateDetected = true;
}