MavenProject (@NotNull Project project, @NotNull MavenProject mavenProject) { MavenProject parentProject = mavenProject; while (parentProject.getParentId() != null) { parentProject = MavenProjectsManager.getInstance(project).findProject(parentProject.getParentId()); if (parentProject == null) return mavenProject; } return parentProject; }