_data.getReport().addDependency(this);
return false;
}
try {
Message.debug("\tusing "+resolver+" to resolve "+getId());
DependencyDescriptor dependencyDescriptor = getDependencyDescriptor(parent);
_data.getEventManager().fireIvyEvent(new StartResolveDependencyEvent(resolver, dependencyDescriptor));
_module = resolver.getDependency(dependencyDescriptor, _data);
_data.getEventManager().fireIvyEvent(new EndResolveDependencyEvent(resolver, dependencyDescriptor, _module));
if (_module != null) {
_data.getCacheManager().saveResolver(_module.getDescriptor(), _module.getResolver().getName());
_data.getCacheManager().saveArtResolver(_module.getDescriptor(), _module.getArtifactResolver().getName());
if (_settings.logModuleWhenFound()) {
Message.info("\tfound "+_module.getId()+" in "+_module.getResolver().getName());
} else {
Message.verbose("\tfound "+_module.getId()+" in "+_module.getResolver().getName());
}
if (_data.getSettings().getVersionMatcher().isDynamic(getId())) {
// IVY-56: check if revision has actually been resolved
if (_data.getSettings().getVersionMatcher().isDynamic(_module.getId())) {
Message.error("impossible to resolve dynamic revision for "+getId()+": check your configuration and make sure revision is part of your pattern");
_problem = new RuntimeException("impossible to resolve dynamic revision");
_data.getReport().addDependency(this);
return false;
}
IvyNode resolved = _data.getNode(_module.getId());
if (resolved != null) {
// exact revision has already been resolved
// => update it and discard this node
_md = _module.getDescriptor(); // needed for handleConfiguration
if (!handleConfiguration(loaded, rootModuleConf, parent, parentConf, conf, shouldBePublic)) {
return false;
}
if (resolved._md == null) {
resolved._md = _md;
}
if (resolved._module == null) {
resolved._module = _module;
}
resolved._downloaded |= _module.isDownloaded();
resolved._searched |= _module.isSearched();
resolved._dds.putAll(_dds);
resolved.updateDataFrom(this, rootModuleConf);
resolved.loadData(rootModuleConf, parent, parentConf, conf, shouldBePublic);
DependencyDescriptor dd = dependencyDescriptor;
if (dd != null) {
resolved.addDependencyArtifacts(rootModuleConf, dd.getDependencyArtifacts(parentConf));
resolved.addDependencyIncludes(rootModuleConf, dd.getIncludeRules(parentConf));
}
_data.replaceNode(getId(), resolved, rootModuleConf); // this actually discards the node
if (_settings.logResolvedRevision()) {
Message.info("\t["+_module.getId().getRevision()+"] "+getId());
} else {
Message.verbose("\t["+_module.getId().getRevision()+"] "+getId());
}
return true;
}
}
_downloaded = _module.isDownloaded();
_searched = _module.isSearched();
} else {
Message.warn("\tmodule not found: "+getId());
resolver.reportFailure();
_problem = new RuntimeException("not found");
}
} catch (Exception e) {
_problem = e;
}
// still not resolved, report error
if (_module == null) {
_data.getReport().addDependency(this);
return false;
} else {
loaded = true;
if (_settings.getVersionMatcher().isDynamic(getId())) {
if (_settings.logResolvedRevision()) {
Message.info("\t["+_module.getId().getRevision()+"] "+getId());
} else {
Message.verbose("\t["+_module.getId().getRevision()+"] "+getId());
}
}
_md = _module.getDescriptor();
_confsToFetch.remove("*");
updateConfsToFetch(
Arrays.asList(
resolveSpecialConfigurations(
getRequiredConfigurations(parent, parentConf), this)));
}
} else {
loaded = true;
}
}
if (hasProblem()) {
_data.getReport().addDependency(this);
return handleConfiguration(loaded, rootModuleConf, parent, parentConf, conf, shouldBePublic) && loaded;
}
if (!handleConfiguration(loaded, rootModuleConf, parent, parentConf, conf, shouldBePublic)) {
return false;
}
DependencyDescriptor dd = getDependencyDescriptor(parent);
if (dd != null) {
addDependencyArtifacts(rootModuleConf, dd.getDependencyArtifacts(parentConf));
addDependencyIncludes(rootModuleConf, dd.getIncludeRules(parentConf));
}
return loaded;
}