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 2018/05/18 20:48:40 UTC
[GitHub] asfgit closed pull request #164: [MNG-6411] Improve readability of
project list for resume option.
asfgit closed pull request #164: [MNG-6411] Improve readability of project list for resume option.
URL: https://github.com/apache/maven/pull/164
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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 ec72e8d81d..fb7a9f4506 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.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 @@ else if ( StringUtils.isNotEmpty( request.getMakeBehavior() ) )
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
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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
With regards,
Apache Git Services
Re: [GitHub] asfgit closed pull request #164: [MNG-6411] Improve
readability of project list for resume option.
Posted by Vishal Kumar Gupta <gr...@gmail.com>.
On Sat, May 19, 2018, 2:18 AM GitBox <gi...@apache.org> wrote:
> asfgit closed pull request #164: [MNG-6411] Improve readability of project
> list for resume option.
> URL: https://github.com/apache/maven/pull/164
>
>
>
>
> This is a PR merged from a forked repository.
> As GitHub hides the original diff on merge, it is displayed below for
> the sake of provenance:
>
> As this is a foreign pull request (from a fork), the diff is supplied
> below (as it won't show otherwise due to GitHub magic):
>
> 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 ec72e8d81d..fb7a9f4506 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.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 @@ else if ( StringUtils.isNotEmpty(
> request.getMakeBehavior() ) )
> 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
>
>
>
>
> ----------------------------------------------------------------
> This is an automated message from the Apache Git Service.
> To respond to the message, please log on 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
>
>
> With regards,
> Apache Git Services
>