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 2021/09/16 19:57:16 UTC

[GitHub] [maven] gastaldi commented on a change in pull request #543: [MNG-7253] Display relocation message defined in model

gastaldi commented on a change in pull request #543:
URL: https://github.com/apache/maven/pull/543#discussion_r710432899



##########
File path: maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
##########
@@ -190,8 +191,20 @@ public DependencyResolutionResult resolve( DependencyResolutionRequest request )
             {
                 if ( !child.getRelocations().isEmpty() )
                 {
-                    logger.warn( "The artifact " + child.getRelocations().get( 0 ) + " has been relocated to "
-                        + child.getDependency().getArtifact() );
+                    org.eclipse.aether.artifact.Artifact artifact = child.getRelocations().get( 0 );
+                    StringBuilder message = new StringBuilder();
+                    message.append( "The artifact " ).append( artifact )

Review comment:
       Your statement is true, however there are two `if`s in the code that would create another `StringBuilder` and I wanted to avoid that




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