Skip to content

Commit c9031cb

Browse files
authored
[MRESOLVER-515] Restore binary compatibility (apache#446)
In cases when AbstractArtifact was extended, the getPath method would go missing. --- https://issues.apache.org/jira/browse/MRESOLVER-515
1 parent 7109153 commit c9031cb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ public Artifact setVersion(String version) {
9696
return newInstance(version, getProperties(), getPath());
9797
}
9898

99+
/**
100+
* This method should (and in Resolver is) overridden, but is kept just to preserve backward compatibility if
101+
* this class is extended somewhere.
102+
*/
103+
public Path getPath() {
104+
File file = getFile();
105+
return file != null ? file.toPath() : null;
106+
}
107+
99108
@Deprecated
100109
@Override
101110
public Artifact setFile(File file) {

0 commit comments

Comments
 (0)