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 18:39:54 UTC

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

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



##########
File path: maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
##########
@@ -187,8 +188,18 @@ 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 );
+                    String message = null;
+                    if ( artifact instanceof RelocatedArtifact )
+                    {
+                        message = ( (RelocatedArtifact) artifact ).getMessage();
+                    }
+                    if ( message == null )
+                    {
+                        message = "The artifact " + artifact + " has been relocated to "
+                                + child.getDependency().getArtifact();
+                    }

Review comment:
       How about we show the original message and append the contents in `<message>`  if it exists?




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