You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2023/03/07 15:39:14 UTC

[GitHub] [maven] gnodet commented on a diff in pull request #1038: [MNG-7720] Wrong build order of forked projects

gnodet commented on code in PR #1038:
URL: https://github.com/apache/maven/pull/1038#discussion_r1128070377


##########
maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java:
##########
@@ -90,18 +89,17 @@ public LifecycleDependencyResolver(ProjectDependenciesResolver projectDependenci
 
     public static List<MavenProject> getProjects(MavenProject project, MavenSession session, boolean aggregator) {
         if (aggregator && project.getCollectedProjects() != null) {
-            return getProjectAndSubModules(project).collect(Collectors.toList());
+            List<MavenProject> downstreamProjects = session.getProjectDependencyGraph()
+                    .getDownstreamProjects(project, true); // sorted but more than needed
+            List<MavenProject> collectedProjects = project.getCollectedProjects(); // not sorted but what we need

Review Comment:
   This should be `getProjectAndSubModules(project).collect(Collectors.toList())` instead of `project.getCollectedProjects()`, else the content will be very different.
   The first one will return the project and all its submodules (recursively), while the second will just return the modules of the current project.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org