use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.MavenDependencyKey in project gradle by gradle.
the class GradlePomModuleDescriptorParser method parseImportedDependencyMgts.
/**
* Parses imported dependency management information.
*
* @param parseContext Parse context
* @param currentDependencyMgts Current dependency management information
* @return Imported dependency management information
*/
private Map<MavenDependencyKey, PomDependencyMgt> parseImportedDependencyMgts(DescriptorParseContext parseContext, Collection<PomDependencyMgt> currentDependencyMgts) throws IOException, SAXException {
Map<MavenDependencyKey, PomDependencyMgt> importedDependencyMgts = new LinkedHashMap<>();
for (PomDependencyMgt currentDependencyMgt : currentDependencyMgts) {
if (isDependencyImportScoped(currentDependencyMgt)) {
ModuleComponentSelector importedId = DefaultModuleComponentSelector.newSelector(DefaultModuleIdentifier.newId(currentDependencyMgt.getGroupId(), currentDependencyMgt.getArtifactId()), new DefaultImmutableVersionConstraint(currentDependencyMgt.getVersion()));
PomReader importedPom = parsePomForSelector(parseContext, importedId, Maps.newHashMap());
for (Map.Entry<MavenDependencyKey, PomDependencyMgt> entry : importedPom.getDependencyMgt().entrySet()) {
if (!importedDependencyMgts.containsKey(entry.getKey())) {
importedDependencyMgts.put(entry.getKey(), entry.getValue());
}
}
}
}
return importedDependencyMgts;
}
use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.MavenDependencyKey in project gradle by gradle.
the class PomReader method resolveDependencyMgt.
private Map<MavenDependencyKey, PomDependencyMgt> resolveDependencyMgt() {
Map<MavenDependencyKey, PomDependencyMgt> dependencies = new LinkedHashMap<>();
dependencies.putAll(pomParent.getDependencyMgt());
dependencies.putAll(importedDependencyMgts);
for (PomDependencyMgt dependencyMgt : parseDependencyMgt()) {
dependencies.put(dependencyMgt.getId(), dependencyMgt);
}
return dependencies;
}
Aggregations