@NotNull
  public static RunnerAndConfigurationSettings createRunnerAndConfigurationSettings(@Nullable MavenGeneralSettings generalSettings,
                                                                                    @Nullable MavenRunnerSettings runnerSettings,
                                                                                    @NotNull MavenRunnerParameters params,
                                                                                    @NotNull Project project,
                                                                                    @NotNull String name,
                                                                                    boolean isDelegate) {
    MavenRunConfigurationType type = ConfigurationTypeUtil.findConfigurationType(MavenRunConfigurationType.class);

    RunnerAndConfigurationSettings settings = RunManager.getInstance(project).createConfiguration(name, type.myFactory);
    MavenRunConfiguration runConfiguration = (MavenRunConfiguration)settings.getConfiguration();
    if (isDelegate) {
      runConfiguration.setBeforeRunTasks(Collections.emptyList());
    }
    MavenGeneralSettings generalSettingsToRun =
      generalSettings != null ? generalSettings : MavenWorkspaceSettingsComponent.getInstance(project).getSettings().getGeneralSettings();
    MavenRunnerSettings runnerSettingsToRun = runnerSettings != null ? runnerSettings : MavenRunner.getInstance(project).getState();
    runConfiguration.setRunnerParameters(params);
    runConfiguration.setGeneralSettings(generalSettingsToRun);
    runConfiguration.setRunnerSettings(runnerSettingsToRun);
    return settings;
  }
@NotNull
  public static RunnerAndConfigurationSettings createRunnerAndConfigurationSettings(@Nullable MavenGeneralSettings generalSettings,
                                                                                    @Nullable MavenRunnerSettings runnerSettings,
                                                                                    @NotNull MavenRunnerParameters params,
                                                                                    @NotNull Project project,
                                                                                    @NotNull String name,
                                                                                    boolean isDelegate)