@Override
  public void actionPerformed(@NotNull AnActionEvent e) {
    Project project = myEnvironment.getProject();
    try {
      MavenRunConfiguration runConfiguration = ((MavenRunConfiguration)myEnvironment.getRunProfile()).clone();

      List<String> goals = runConfiguration.getRunnerParameters().getGoals();

      if (goals.size() > 2 && "-rf".equals(goals.get(goals.size() - 2))) { // This runConfiguration was created by other MavenResumeAction.
        goals.set(goals.size() - 1, myResumeModuleId);
      }
      else {
        goals.add("-rf");
        goals.add(myResumeModuleId);
      }

      runConfiguration.getRunnerParameters().setGoals(goals);

      myRunner.execute(new ExecutionEnvironmentBuilder(myEnvironment).contentToReuse(null).runProfile(runConfiguration).build());
    }
    catch (RunCanceledByUserException ignore) {
    }
    catch (ExecutionException e1) {
      Messages.showErrorDialog(project, e1.getMessage(), ExecutionBundle.message("restart.error.message.title"));
    }
  }
@Override
  public void actionPerformed(@NotNull AnActionEvent e)