void (@NotNull Project project, @NotNull PsiFile file, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { try { PsiFile psiFile = (PsiFile)startElement; VirtualFile modulePom = createModulePom(psiFile.getVirtualFile()); MavenId id = MavenDomUtil.describe(psiFile); String groupId = id.getGroupId() == null ? "groupId" : id.getGroupId(); String artifactId = modulePom.getParent().getName(); String version = id.getVersion() == null ? "version" : id.getVersion(); MavenUtil.runOrApplyMavenProjectFileTemplate(project, modulePom, new MavenId(groupId, artifactId, version), myWithParent ? id : null, psiFile.getVirtualFile(), true); } catch (IOException e) { MavenUtil.showError(project, MavenProjectBundle.message("notification.title.cannot.create.module"), e); } }