use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomDependencyMgt in project gradle by gradle.
the class GradlePomModuleDescriptorBuilder method getDefaultScope.
private String getDefaultScope(PomDependencyData dep) {
PomDependencyMgt pomDependencyMgt = findDependencyDefault(dep);
String result = null;
if (pomDependencyMgt != null) {
result = pomDependencyMgt.getScope();
}
if ((result == null) || !SCOPES.containsKey(result)) {
result = "compile";
}
return result;
}
use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomDependencyMgt in project gradle by gradle.
the class GradlePomModuleDescriptorBuilder method getDefaultScope.
private String getDefaultScope(PomDependencyMgt dep) {
PomDependencyMgt pomDependencyMgt = findDependencyDefault(dep);
String result = null;
if (pomDependencyMgt != null) {
result = pomDependencyMgt.getScope();
}
if ((result == null) || !SCOPES.containsKey(result)) {
result = "compile";
}
return result;
}
use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomDependencyMgt 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
* @throws IOException
* @throws SAXException
*/
private Map<MavenDependencyKey, PomDependencyMgt> parseImportedDependencyMgts(DescriptorParseContext parseContext, Collection<PomDependencyMgt> currentDependencyMgts) throws IOException, SAXException {
Map<MavenDependencyKey, PomDependencyMgt> importedDependencyMgts = new LinkedHashMap<MavenDependencyKey, PomDependencyMgt>();
for (PomDependencyMgt currentDependencyMgt : currentDependencyMgts) {
if (isDependencyImportScoped(currentDependencyMgt)) {
ModuleComponentSelector importedId = DefaultModuleComponentSelector.newSelector(currentDependencyMgt.getGroupId(), currentDependencyMgt.getArtifactId(), new DefaultMutableVersionConstraint(currentDependencyMgt.getVersion()));
PomReader importedPom = parsePomForSelector(parseContext, importedId, Maps.<String, String>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.PomDependencyMgt in project gradle by gradle.
the class PomReader method resolveDependencyMgt.
private Map<MavenDependencyKey, PomDependencyMgt> resolveDependencyMgt() {
Map<MavenDependencyKey, PomDependencyMgt> dependencies = new LinkedHashMap<MavenDependencyKey, PomDependencyMgt>();
dependencies.putAll(pomParent.getDependencyMgt());
dependencies.putAll(importedDependencyMgts);
for (PomDependencyMgt dependencyMgt : parseDependencyMgt()) {
dependencies.put(dependencyMgt.getId(), dependencyMgt);
}
return dependencies;
}
use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomDependencyMgt in project gradle by gradle.
the class PomReader method parseDependencyMgt.
/**
* Parses the dependency management elements declared in this POM without removing the duplicates.
*
* @return Parsed dependency management elements
*/
public List<PomDependencyMgt> parseDependencyMgt() {
if (declaredDependencyMgts == null) {
List<PomDependencyMgt> dependencyMgts = getDependencyMgt(projectElement);
for (PomProfile pomProfile : parseActivePomProfiles()) {
for (PomDependencyMgt dependencyMgt : pomProfile.getDependencyMgts()) {
dependencyMgts.add(dependencyMgt);
}
}
declaredDependencyMgts = dependencyMgts;
}
return declaredDependencyMgts;
}
Aggregations