MavenDomDependency (@NotNull final MavenDomProjectModel mavenModel, final Editor editor) { Project project = mavenModel.getManager().getProject(); final Map<DependencyConflictId, MavenDomDependency> managedDependencies = GenerateManagedDependencyAction.collectManagingDependencies(mavenModel); final List<MavenId> ids = MavenArtifactSearchDialog.searchForArtifact(project, managedDependencies.values()); if (ids.isEmpty()) return null; PsiDocumentManager.getInstance(project).commitAllDocuments(); XmlFile psiFile = DomUtil.getFile(mavenModel); return createDependencyInWriteAction(mavenModel, editor, managedDependencies, ids, psiFile); }