@Override
  public MavenServerResponse<ArrayList<PluginResolutionResponse>> resolvePlugins(@NotNull LongRunningTaskInput longRunningTaskInput,
                                                                                 @NotNull ArrayList<PluginResolutionRequest> pluginResolutionRequests,
                                                                                 boolean forceUpdateSnapshots,
                                                                                 MavenToken token) {
    MavenServerUtil.checkToken(token);
    String longRunningTaskId = longRunningTaskInput.getLongRunningTaskId();
    MavenServerOpenTelemetry telemetry = MavenServerOpenTelemetry.of(longRunningTaskInput);
    boolean runInParallel = canResolveDependenciesInParallel();
    try (LongRunningTask task = newLongRunningTask(longRunningTaskId, pluginResolutionRequests.size(), myConsoleWrapper)) {
      MavenExecutionRequest request = createRequest(null, null, null);
      request.setTransferListener(new Maven40TransferListenerAdapter(task.getIndicator()));
      request.setUpdateSnapshots(myAlwaysUpdateSnapshots || forceUpdateSnapshots);

      DefaultMaven maven = (DefaultMaven)getComponent(Maven.class);
      RepositorySystemSession session = maven.newRepositorySession(request);
      myImporterSpy.setIndicator(task.getIndicator());

      List<PluginResolutionData> resolutions = new ArrayList<>();

      for (PluginResolutionRequest pluginResolutionRequest : pluginResolutionRequests) {
        MavenId mavenPluginId = pluginResolutionRequest.getMavenPluginId();
        int nativeMavenProjectId = pluginResolutionRequest.getNativeMavenProjectId();

        String groupId = mavenPluginId.getGroupId();
        String artifactId = mavenPluginId.getArtifactId();

        MavenProject project = RemoteNativeMaven40ProjectHolder.findProjectById(nativeMavenProjectId);
        List<RemoteRepository> remoteRepos = project.getRemotePluginRepositories();

        Plugin pluginFromProject = project.getBuild().getPluginsAsMap().get(groupId + ':' + artifactId);
        List<Dependency> pluginDependencies =
          null == pluginFromProject ? Collections.emptyList() : pluginFromProject.getDependencies();

        PluginResolutionData resolution = new PluginResolutionData(mavenPluginId, pluginDependencies, remoteRepos);
        resolutions.add(resolution);
      }
      // IDEA-341451: Parallel plugin resolution hangs in Maven 4.0.0-alpha-9
      // It worked fine up until Maven 4.0.0-alpha-8
      List<PluginResolutionResponse> results = ParallelRunnerForServer.execute(false, resolutions, resolution ->
        resolvePlugin(task, resolution.mavenPluginId, resolution.pluginDependencies, resolution.remoteRepos, session)
      );
      byte[] telemetryTrace = telemetry.shutdown();
      return new MavenServerResponse<>(new ArrayList<>(results), getLongRunningTaskStatus(longRunningTaskId, token), telemetryTrace);
    }
  }
@Override
  public MavenServerResponse<ArrayList<PluginResolutionResponse>> resolvePlugins(@NotNull LongRunningTaskInput longRunningTaskInput,
                                                                                 @NotNull ArrayList<PluginResolutionRequest> pluginResolutionRequests,
                                                                                 boolean forceUpdateSnapshots,
                                                                                 MavenToken token)