VirtualFile (@NotNull Module module, @NotNull MavenModelsProvider modelsProvider) { String pomFileUrl = MavenPomPathModuleService.getInstance(module).getPomFileUrl(); if (pomFileUrl != null) { return VirtualFileManager.getInstance().findFileByUrl(pomFileUrl); } for (VirtualFile root : modelsProvider.getContentRoots(module)) { List<VirtualFile> pomFiles = MavenUtil.streamPomFiles(module.getProject(), root).toList(); if (pomFiles.isEmpty()) { continue; } if (pomFiles.size() == 1) { return pomFiles.get(0); } for (VirtualFile file : pomFiles) { if (module.getName().equals(file.getNameWithoutExtension())) { return file; } MavenProject mavenProject = findProject(file); if (mavenProject != null) { if (module.getName().equals(mavenProject.getMavenId().getArtifactId())) { return file; } } } } return null; }