You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/07/17 06:16:04 UTC

[GitHub] [maven] mthmulders commented on a change in pull request #340: [MNG-5571] Resume from generates misleading hint when multiple projects fail.

mthmulders commented on a change in pull request #340:
URL: https://github.com/apache/maven/pull/340#discussion_r456239884



##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
##########
@@ -1034,12 +1035,19 @@ private int execute( CliRequest cliRequest )
             List<MavenProject> sortedProjects = result.getTopologicallySortedProjects();
             if ( result.canResume() )
             {
-                logBuildResumeHint( "mvn <args> -r " );
+                logBuildResumeHint( "mvn <args> -r" );
             }
-            else if ( project != null && !project.equals( sortedProjects.get( 0 ) ) )
+            else if ( !failedProjects.isEmpty() )
             {
-                String resumeFromSelector = getResumeFromSelector( sortedProjects, project );
-                logBuildResumeHint( "mvn <args> -rf " + resumeFromSelector );
+                // Sort the failedProjects list in the topologically sorted order.
+                failedProjects.sort( comparing( sortedProjects::indexOf ) );
+
+                MavenProject firstFailedProject = failedProjects.get( 0 );
+                if ( !firstFailedProject.equals( sortedProjects.get( 0 ) ) )

Review comment:
       Either we're missing an `else` branch here, or the condition will always evaluate to true due to the `canResume()` check before?




----------------------------------------------------------------
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.

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