use of org.apache.ivy.plugins.parser.ModuleDescriptorParser in project ant-ivy by apache.
the class BasicResolver method parse.
public ResolvedModuleRevision parse(final ResolvedResource mdRef, DependencyDescriptor dd, ResolveData data) throws ParseException {
DependencyDescriptor nsDd = dd;
dd = toSystem(nsDd);
ModuleRevisionId mrid = dd.getDependencyRevisionId();
ModuleDescriptorParser parser = ModuleDescriptorParserRegistry.getInstance().getParser(mdRef.getResource());
if (parser == null) {
Message.warn("no module descriptor parser available for " + mdRef.getResource());
return null;
}
Message.verbose("\t" + getName() + ": found md file for " + mrid);
Message.verbose("\t\t=> " + mdRef);
Message.debug("\tparser = " + parser);
ModuleRevisionId resolvedMrid = mrid;
// first check if this dependency has not yet been resolved
if (getSettings().getVersionMatcher().isDynamic(mrid)) {
resolvedMrid = ModuleRevisionId.newInstance(mrid, mdRef.getRevision());
IvyNode node = data.getNode(resolvedMrid);
if (node != null && node.getModuleRevision() != null) {
// this revision has already be resolved : return it
if (node.getDescriptor() == null || !node.getDescriptor().isDefault()) {
Message.verbose("\t" + getName() + ": revision already resolved: " + resolvedMrid);
node.getModuleRevision().getReport().setSearched(true);
return node.getModuleRevision();
}
Message.verbose("\t" + getName() + ": found already resolved revision: " + resolvedMrid + ": but it's a default one, maybe we can find a better one");
}
}
Artifact moduleArtifact = parser.getMetadataArtifact(resolvedMrid, mdRef.getResource());
return getRepositoryCacheManager().cacheModuleDescriptor(this, mdRef, dd, moduleArtifact, downloader, getCacheOptions(data));
}
Aggregations