private static void applyDefaults(MavenWorkspaceSettings settings) {
   if (StringUtil.isEmptyOrSpaces(settings.generalSettings.getMavenHome())) {
     if (MavenServerManager.getInstance().isUsedMaven2ForProjectImport()
         || ApplicationManager.getApplication().isUnitTestMode()) {
       settings.generalSettings.setMavenHome(MavenServerManager.BUNDLED_MAVEN_2);
     } else {
       settings.generalSettings.setMavenHome(MavenServerManager.BUNDLED_MAVEN_3);
     }
   }
 }
Beispiel #2
0
 @NotNull
 public static VirtualFile resolveSuperPomFile(@Nullable File mavenHome) {
   VirtualFile result = null;
   if (mavenHome != null) {
     result = doResolveSuperPomFile(new File(mavenHome, LIB_DIR));
   }
   if (result == null) {
     result = doResolveSuperPomFile(MavenServerManager.getMavenLibDirectory());
   }
   return result;
 }
  @Override
  public void actionPerformed(@NotNull AnActionEvent event) {
    final Project project = MavenActionUtil.getProject(event.getDataContext());
    if (project == null) return;
    final VirtualFile file = findPomXml(event.getDataContext());
    if (file == null) return;

    if (MavenServerManager.getInstance().isUseMaven2()) {
      showUnsupportedNotification(project, file);
    } else {
      actionPerformed(project, file);
    }
  }