diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java index 2e277f0e4c1d..85fa6046f3c4 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java @@ -86,6 +86,39 @@ public String getVersion() } } + @Override + public Artifact setVersion( String version ) + { + String current = getVersion(); + if ( current.equals( version ) || ( version == null && current.length() <= 0 ) ) + { + return this; + } + return new RelocatedArtifact( artifact, groupId, artifactId, version ); + } + + @Override + public Artifact setFile( File file ) + { + File current = getFile(); + if ( Objects.equals( current, file ) ) + { + return this; + } + return new RelocatedArtifact( artifact.setFile( file ), groupId, artifactId, version ); + } + + @Override + public Artifact setProperties( Map properties ) + { + Map current = getProperties(); + if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) ) + { + return this; + } + return new RelocatedArtifact( artifact.setProperties( properties ), groupId, artifactId, version ); + } + public String getClassifier() { return artifact.getClassifier();