@Nullable public static MavenDomDependency searchManagingDependency( @NotNull final MavenDomDependency dependency, @NotNull final Project project) { final DependencyConflictId depId = DependencyConflictId.create(dependency); if (depId == null) return null; final MavenDomProjectModel model = dependency.getParentOfType(MavenDomProjectModel.class, false); if (model == null) return null; final Ref<MavenDomDependency> res = new Ref<MavenDomDependency>(); Processor<MavenDomDependency> processor = dependency1 -> { if (depId.equals(DependencyConflictId.create(dependency1))) { res.set(dependency1); return true; } return false; }; processDependenciesInDependencyManagement(model, processor, project); return res.get(); }
@NotNull public static Set<MavenDomDependency> searchDependencyUsages( @NotNull final MavenDomDependency dependency) { final MavenDomProjectModel model = dependency.getParentOfType(MavenDomProjectModel.class, false); if (model != null) { DependencyConflictId dependencyId = DependencyConflictId.create(dependency); if (dependencyId != null) { return searchDependencyUsages(model, dependencyId, Collections.singleton(dependency)); } } return Collections.emptySet(); }