MavenServerResponse<ArrayList<PluginResolutionResponse>> (@NotNull String longRunningTaskId, @NotNull ArrayList<PluginResolutionRequest> pluginResolutionRequests, boolean forceUpdateSnapshots, MavenToken token) { MavenServerUtil.checkToken(token); 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); } List<PluginResolutionResponse> results = ParallelRunner.execute(runInParallel, resolutions, resolution -> resolvePlugin(task, resolution.mavenPluginId, resolution.pluginDependencies, resolution.remoteRepos, session) ); return new MavenServerResponse<>(new ArrayList<>(results), getLongRunningTaskStatus(longRunningTaskId, token)); } }