List<MavenRunnerParameters> (@NotNull List<MavenTaskInfo> taskInfos, MavenExplicitProfiles explicitProfiles) { if (taskInfos.isEmpty()) return List.of(); var enabledProfiles = explicitProfiles.getEnabledProfiles(); var disabledProfiles = explicitProfiles.getDisabledProfiles(); List<MavenRunnerParameters> parametersList = new ArrayList<>(); Collection<List<MavenTaskInfo>> taskGroups = taskInfos.stream().collect(groupingBy(MavenTaskInfo::goalAndRootProject)).values(); for (var tasksInGroup : taskGroups) { MavenRunnerParameters params; var firstTask = tasksInGroup.get(0); params = new MavenRunnerParameters(true, firstTask.file().getParent().getPath(), firstTask.file().getName(), Collections.singletonList(firstTask.goal()), enabledProfiles, disabledProfiles); if (tasksInGroup.size() > 1) { var workingDirPath = firstTask.rootProject().getDirectory(); params.setWorkingDirPath(workingDirPath); var projectsCmdOptionValues = tasksInGroup.stream() .map(task -> task.mavenProject().getMavenId()) .map(mavenId -> mavenId.getGroupId() + ":" + mavenId.getArtifactId()) .toList(); params.setProjectsCmdOptionValues(projectsCmdOptionValues); } parametersList.add(params); } return parametersList; }