void (@NotNull MavenDomProjectModel projectModel, @NotNull DomElementAnnotationHolder holder) { MultiMap<DependencyConflictId, MavenDomDependency> allDuplicates = getDuplicateDependenciesMap(projectModel); for (MavenDomDependency dependency : projectModel.getDependencies().getDependencies()) { DependencyConflictId id = DependencyConflictId.create(dependency); if (id != null) { Collection<MavenDomDependency> dependencies = allDuplicates.get(id); if (dependencies.size() > 1) { List<MavenDomDependency> duplicatedDependencies = new ArrayList<>(); for (MavenDomDependency d : dependencies) { if (d == dependency) continue; if (d.getParent() == dependency.getParent()) { duplicatedDependencies.add(d); // Dependencies in the same file must be unique by groupId:artifactId:type:classifier } else { if (scope(d).equals(scope(dependency)) && Objects.equals(d.getVersion().getStringValue(), dependency.getVersion().getStringValue())) { duplicatedDependencies.add(d); // Dependencies in different files must not have same groupId:artifactId:VERSION:type:classifier:SCOPE } } } if (duplicatedDependencies.size() > 0) { addProblem(dependency, duplicatedDependencies, holder); } } } } }