use of org.jetbrains.idea.maven.dom.DependencyConflictId in project intellij-community by JetBrains.
the class MavenDuplicateDependenciesInspection method checkManagedDependencies.
private static void checkManagedDependencies(@NotNull MavenDomProjectModel projectModel, @NotNull DomElementAnnotationHolder holder) {
MultiMap<DependencyConflictId, MavenDomDependency> duplicates = MultiMap.createSet();
collect(duplicates, projectModel.getDependencyManagement().getDependencies());
for (Map.Entry<DependencyConflictId, Collection<MavenDomDependency>> entry : duplicates.entrySet()) {
Collection<MavenDomDependency> set = entry.getValue();
if (set.size() <= 1)
continue;
for (MavenDomDependency dependency : set) {
holder.createProblem(dependency, HighlightSeverity.WARNING, "Duplicated dependency");
}
}
}
use of org.jetbrains.idea.maven.dom.DependencyConflictId in project intellij-community by JetBrains.
the class MavenDuplicateDependenciesInspection method collect.
private static void collect(MultiMap<DependencyConflictId, MavenDomDependency> duplicates, @NotNull MavenDomDependencies dependencies) {
for (MavenDomDependency dependency : dependencies.getDependencies()) {
DependencyConflictId mavenId = DependencyConflictId.create(dependency);
if (mavenId == null)
continue;
duplicates.putValue(mavenId, dependency);
}
}
Aggregations