slawekjaranowski commented on a change in pull request #544:
URL: https://github.com/apache/maven/pull/544#discussion_r710359721
##########
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:
Does relocation message contains coordinate of reallocated artifact from
source to destination gav?
If no we lost useful information like:
```
The artifact xxx has been relocated to yyy
```
##########
File path:
maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
##########
@@ -41,13 +41,16 @@
private final String version;
- RelocatedArtifact( Artifact artifact, String groupId, String artifactId,
String version )
+ private final String message;
+
+ RelocatedArtifact( Artifact artifact, String groupId, String artifactId,
String version, String message )
Review comment:
Javadoc with parameters description will be useful.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]