提交 f38109c8 编写于 作者: J jurgen

Maven drivers download

Former-commit-id: 5ac40ddc
上级 a55ff818
......@@ -432,6 +432,7 @@ public class DriverFileDescriptor implements DBPDriverFile
monitor.worked(1);
String versionInfo = artifactInfo[2];
List<String> allVersions = artifact.getVersions();
if (versionInfo.equals("release")) {
versionInfo = artifact.getReleaseVersion();
} else if (versionInfo.equals("latest")) {
......@@ -442,7 +443,7 @@ public class DriverFileDescriptor implements DBPDriverFile
String regex = versionInfo.substring(1, versionInfo.length() - 1);
try {
Pattern versionPattern = Pattern.compile(regex);
List<String> versions = new ArrayList<String>(artifact.getVersions());
List<String> versions = new ArrayList<String>(allVersions);
Collections.reverse(versions);
for (String version : versions) {
if (versionPattern.matcher(version).matches()) {
......@@ -455,6 +456,13 @@ public class DriverFileDescriptor implements DBPDriverFile
}
}
}
if (CommonUtils.isEmpty(versionInfo)) {
if (allVersions.isEmpty()) {
throw new IOException("Artifact '" + artifact + "' has empty version list");
}
// Use latest version
versionInfo = allVersions.get(allVersions.size() - 1);
}
monitor.subTask("Download binaries for version " + versionInfo);
if (localVersion == null) {
artifact.makeLocalVersion(versionInfo, true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册