MavenDistribution () { var projectsManager = MavenProjectsManager.getInstance(myProject); MavenWorkspaceSettings settings = MavenWorkspaceSettingsComponent.getInstance(myProject).getSettings(); MavenHomeType type = settings.getGeneralSettings().getMavenHomeType(); if (type instanceof MavenWrapper) { var baseDir = myProject.getBasePath(); var projects = projectsManager.getProjects(); if (projects.size() > 0) { baseDir = projects.get(0).getDirectory(); } if (baseDir != null) { String multiModuleDir = myWorkingDirToMultiModuleMap.computeIfAbsent(baseDir, this::resolveMultiModuleDirectory); return myMultimoduleDirToWrapperedMavenDistributionsMap.computeIfAbsent(multiModuleDir, this::getWrapperDistribution); } } else if (type instanceof MavenInSpecificPath sp) { MavenDistribution mavenDistribution = fromPath(sp.getMavenHome(), sp.getTitle()); if (mavenDistribution != null) return mavenDistribution; } else if (type instanceof BundledMaven3 || type instanceof BundledMaven4) { return resolveEmbeddedMavenHome(); } projectsManager.getSyncConsole().addWarning(SyncBundle.message("cannot.resolve.maven.home"), SyncBundle .message("is.not.correct.maven.home.reverting.to.embedded", settings.getGeneralSettings().getMavenHomeType().getTitle())); return resolveEmbeddedMavenHome(); }