MartinKanters commented on a change in pull request #340: URL: https://github.com/apache/maven/pull/340#discussion_r456258859
########## 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: I think there is a rare situation where this check would be valid: resume.properties could not be persisted somehow ( `setCanResume( true )` will not be called) and then we still need this check to verify that the first project succeeded (otherwise -rf does not make sense). It's a very much edge case, though. We could remove it altogether, but let's first monitor for some time if -r is performing well? ---------------------------------------------------------------- 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: us...@infra.apache.org