maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject [maven] branch master updated: [MNG-6411] Improve readability of project list returned when --resume-from option value is invalid
Date Fri, 18 May 2018 20:48:26 GMT
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/master by this push:
     new 454a4e7  [MNG-6411] Improve readability of project list returned when --resume-from
option value is invalid
454a4e7 is described below

commit 454a4e7954deb94e8d10f916405a6a5f6137c0fc
Author: Ɓukasz Dywicki <luke@code-house.org>
AuthorDate: Fri May 11 15:38:04 2018 +0200

    [MNG-6411] Improve readability of project list returned when --resume-from option value
is invalid
    
    This closes #164
---
 .../org/apache/maven/graph/DefaultGraphBuilder.java   | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java b/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
index ec72e8d..fb7a9f4 100644
--- a/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
@@ -25,6 +25,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -311,13 +312,29 @@ public class DefaultGraphBuilder
             if ( !resumed )
             {
                 throw new MavenExecutionException( "Could not find project to resume reactor
build from: " + selector
-                    + " vs " + projects, request.getPom() );
+                    + " vs " + formatProjects( projects ), request.getPom() );
             }
         }
 
         return result;
     }
 
+    private String formatProjects( List<MavenProject> projects )
+    {
+        StringBuilder projectNames = new StringBuilder();
+        Iterator<MavenProject> iterator = projects.iterator();
+        while ( iterator.hasNext() )
+        {
+            MavenProject project = iterator.next();
+            projectNames.append( project.getGroupId() ).append( ":" ).append( project.getArtifactId()
);
+            if ( iterator.hasNext() )
+            {
+                projectNames.append( ", " );
+            }
+        }
+        return projectNames.toString();
+    }
+
     private boolean isMatchingProject( MavenProject project, String selector, File reactorDirectory
)
     {
         // [groupId]:artifactId

-- 
To stop receiving notification emails like this one, please contact
michaelo@apache.org.

Mime
View raw message