@Override
  public void invoke(@NotNull final Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
    final Module module = ModuleUtilCore.findModuleForPsiElement(file);
    assert module != null;

    final VirtualFile vfile = file.getOriginalFile().getVirtualFile();
    assert vfile != null;

    if (JavaPsiFacade.getInstance(project).findClass("org.apache.ivy.core.report.ResolveReport", file.getResolveScope()) == null) {
      Messages.showErrorDialog(
        GroovyBundle.message("grab.error.ivy.missing.message"),
        GroovyBundle.message("grab.error.ivy.missing.title")
      );
      return;
    }

    Map<String, String> queries = prepareQueries(file);

    final Map<@NlsSafe String, GeneralCommandLine> lines = new HashMap<>();
    for (@NlsSafe String grabText : queries.keySet()) {
      final JavaParameters javaParameters = GroovyScriptRunConfiguration.createJavaParametersWithSdk(module);
      //debug
      //javaParameters.getVMParametersList().add("-Xdebug");
      //javaParameters.getVMParametersList().add("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5239");

      try {
        DefaultGroovyScriptRunner.configureGenericGroovyRunner(javaParameters, module, GRAPE_RUNNER, false, true, true, false);
        javaParameters.getClassPath().add(PathUtil.getJarPathForClass(GrapeRunner.class));
        javaParameters.getProgramParametersList().add(queries.get(grabText));
        javaParameters.setUseDynamicClasspath(project);
        lines.put(grabText, javaParameters.toCommandLine());
      }
      catch (CantRunException e) {
        String title = GroovyBundle.message("grab.error.0.title", ExceptionUtil.getMessage(e));
        NOTIFICATION_GROUP.createNotification(title, ExceptionUtil.getThrowableText(e), NotificationType.ERROR).notify(project);
        return;
      }
    }

    ProgressManager.getInstance().run(new Task.Backgroundable(project, GroovyBundle.message("grab.progress.title")) {
      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        int totalJarCount = 0;
        HtmlBuilder messages = new HtmlBuilder();

        for (Map.Entry<@NlsSafe String, GeneralCommandLine> entry : lines.entrySet()) {
          String grabText = entry.getKey();
          indicator.setText2(grabText);
          try {
            final GrapeProcessHandler handler = new GrapeProcessHandler(entry.getValue(), module);
            handler.startNotify();
            handler.waitFor();
            int jarCount = handler.jarCount;
            totalJarCount += jarCount;
            messages.append(HtmlChunk.p().children(
              HtmlChunk.raw(GroovyBundle.message("grab.jar.count", grabText, jarCount)),
              handler.messages
            ));
          }
          catch (ExecutionException e) {
            LOG.error(e);
          }
        }

        final String title = GroovyBundle.message("grab.result.title", totalJarCount);
        NOTIFICATION_GROUP.createNotification(title, messages.toString(), NotificationType.INFORMATION).notify(project);
      }
    });
  }
@Override
  public void invoke(@NotNull final Project project, Editor editor, PsiFile file)