MavenDomDependency (@NotNull final MavenDomProjectModel mavenModel, final Editor editor) { Set<DependencyConflictId> existingDependencies = collectExistingDependencies(mavenModel); Map<DependencyConflictId, MavenDomDependency> managingDependencies = collectManagingDependencies(mavenModel); Map<DependencyConflictId, MavenDomDependency> unexistManagingDeps = Maps.filterKeys(managingDependencies, Predicates.not(Predicates.in(existingDependencies))); final List<MavenDomDependency> dependenciesToOverride = GenerateDependencyUtil.chooseDependencies(unexistManagingDeps.values(), mavenModel.getManager().getProject()); if (!dependenciesToOverride.isEmpty()) { return WriteCommandAction.writeCommandAction(editor.getProject(), mavenModel.getXmlTag().getContainingFile()).compute(() -> { MavenDomDependency dependency = null; for (MavenDomDependency parentDependency : dependenciesToOverride) { String groupId = parentDependency.getGroupId().getStringValue(); String artifactId = parentDependency.getArtifactId().getStringValue(); if (!StringUtil.isEmptyOrSpaces(groupId) && !StringUtil.isEmptyOrSpaces(artifactId)) { dependency = MavenDomUtil.createDomDependency(mavenModel, editor); dependency.getGroupId().setStringValue(groupId); dependency.getArtifactId().setStringValue(artifactId); String typeValue = parentDependency.getType().getStringValue(); String classifier = parentDependency.getClassifier().getStringValue(); if (!StringUtil.isEmptyOrSpaces(typeValue)) { dependency.getType().setStringValue(typeValue); } if (!StringUtil.isEmptyOrSpaces(classifier)) { dependency.getClassifier().setStringValue(classifier); } dependency.getVersion().undefine(); } } return dependency; }); } return null; }