List<String> (MavenProject project) { LinkedHashSet<String> result = new LinkedHashSet<>(MavenConstants.PHASES); // may contains similar plugins or something for (MavenPlugin each : project.getDeclaredPlugins()) { collectGoals(project.getLocalRepository(), each, result); } return new ArrayList<>(result); }