fix: Version.jar should be resolved to id of self if null instead of the id of ancestor.
This commit is contained in:
@@ -163,7 +163,7 @@ public class Version implements Comparable<Version>, Validation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getJar() {
|
public String getJar() {
|
||||||
return jar;
|
return jar == null ? id : jar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInheritsFrom() {
|
public String getInheritsFrom() {
|
||||||
@@ -275,14 +275,14 @@ public class Version implements Comparable<Version>, Validation {
|
|||||||
|
|
||||||
if (inheritsFrom == null) {
|
if (inheritsFrom == null) {
|
||||||
if (isRoot())
|
if (isRoot())
|
||||||
thisVersion = new Version(id).setPatches(patches).setJar(id);
|
thisVersion = new Version(id).setPatches(patches);
|
||||||
else
|
else
|
||||||
thisVersion = this.jar == null ? this.setJar(id) : this;
|
thisVersion = this;
|
||||||
} else {
|
} else {
|
||||||
// To maximize the compatibility.
|
// To maximize the compatibility.
|
||||||
if (!resolvedSoFar.add(id)) {
|
if (!resolvedSoFar.add(id)) {
|
||||||
Logging.LOG.log(Level.WARNING, "Found circular dependency versions: " + resolvedSoFar);
|
Logging.LOG.log(Level.WARNING, "Found circular dependency versions: " + resolvedSoFar);
|
||||||
thisVersion = this.jar == null ? this.setJar(id) : this;
|
thisVersion = this;
|
||||||
} else {
|
} else {
|
||||||
// It is supposed to auto install an version in getVersion.
|
// It is supposed to auto install an version in getVersion.
|
||||||
thisVersion = merge(provider.getVersion(inheritsFrom).resolve(provider, resolvedSoFar), false);
|
thisVersion = merge(provider.getVersion(inheritsFrom).resolve(provider, resolvedSoFar), false);
|
||||||
|
|||||||
Reference in New Issue
Block a user