gradle: do not perform import of maven repositories after project open if auto-import...
[idea/community.git] / plugins / gradle / src / org / jetbrains / plugins / gradle / integrations / maven / GradleMavenProjectImportNotificationListener.java
index 089bc1a96dfa5d68aeb490ed10af1f6327b72877..30f399fc9b7b6dd00157fc183d95ae1d1b8dba78 100644 (file)
@@ -18,12 +18,11 @@ package org.jetbrains.plugins.gradle.integrations.maven;
 import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
 import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListenerAdapter;
 import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType;
+import com.intellij.openapi.project.DumbService;
 import com.intellij.openapi.project.Project;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.plugins.gradle.util.GradleConstants;
 
-import static javax.swing.SwingUtilities.invokeLater;
-
 /**
  * {@link GradleMavenProjectImportNotificationListener} listens for Gradle project import events.
  *
@@ -38,7 +37,7 @@ public class GradleMavenProjectImportNotificationListener extends ExternalSystem
         && id.getType() == ExternalSystemTaskType.RESOLVE_PROJECT) {
       final Project project = id.findProject();
       if (project == null) return;
-      invokeLater(new ImportMavenRepositoriesTask(project));
+      DumbService.getInstance(project).smartInvokeLater(new ImportMavenRepositoriesTask(project));
     }
   }
 }