void (Project project, @NotNull MavenRunnerParameters params, @Nullable MavenGeneralSettings settings, @Nullable MavenRunnerSettings runnerSettings, @Nullable ProgramRunner.Callback callback, boolean isDelegateBuild) { if (!ExternalSystemUtil.confirmLoadingUntrustedProject(project, MavenUtil.SYSTEM_ID)) { MavenUtil.showError(project, RunnerBundle.message("notification.title.failed.to.execute.maven.goal"), RunnerBundle.message("notification.project.is.untrusted")); return; } RunnerAndConfigurationSettings configSettings = createRunnerAndConfigurationSettings(settings, runnerSettings, params, project, generateName(project, params), isDelegateBuild); ProgramRunner runner = isDelegateBuild ? DelegateBuildRunner.Util.getDelegateRunner() : DefaultJavaProgramRunner.getInstance(); Executor executor = DefaultRunExecutor.getRunExecutorInstance(); ExecutionEnvironment environment = new ExecutionEnvironment(executor, runner, configSettings, project); environment.putUserData(IS_DELEGATE_BUILD, isDelegateBuild); environment.setCallback(callback); ApplicationManager.getApplication().invokeAndWait(() -> { try { runner.execute(environment); } catch (ExecutionException e) { MavenUtil.showError(project, RunnerBundle.message("notification.title.failed.to.execute.maven.goal"), e); } }); }