List<String> (boolean qualifiedGoals, @NotNull List<MavenSimpleNode> selectedNodes) { List<ProjectNode> projectNodes = filterNodesByClass(selectedNodes, ProjectNode.class); final ProjectNode projectNode = projectNodes.size() == 1 ? projectNodes.get(0) : null; if (projectNode != null) { MavenProject project = projectNode.getMavenProject(); String goal = project.getDefaultGoal(); if (!StringUtil.isEmptyOrSpaces(goal)) { // Maven uses StringTokenizer to split defaultGoal. See DefaultLifecycleTaskSegmentCalculator#calculateTaskSegments() return ContainerUtil.newArrayList(StringUtil.tokenize(new StringTokenizer(goal))); } } else { List<MavenGoalNode> goalNodes = filterNodesByClass(selectedNodes, MavenGoalNode.class); if (getCommonProjectNode(goalNodes) == null) { return null; } final List<String> goals = new ArrayList<>(); for (MavenGoalNode node : goalNodes) { goals.add(qualifiedGoals ? node.getGoal() : node.getName()); } goals.sort(myGoalOrderComparator); return goals; } return null; }