1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Handle failed range look ups better.

This commit is contained in:
Cedric Beust 2016-08-06 09:45:04 -07:00
parent 89d2239209
commit 99444740da

View file

@ -203,10 +203,14 @@ class Aether(localRepo: File, val settings: KobaltSettings, val eventBus: EventB
if (KobaltAether.isRangeVersion(artifact.version)) {
val request = rangeRequest(artifact)
val v = system.resolveVersionRange(session, request)
val highestVersion = v.highestVersion.toString()
val ar = DefaultArtifact(artifact.groupId, artifact.artifactId, artifact.classifier,
artifact.extension, highestVersion)
listOf(AetherResult(ar, request.repositories[0]))
if (v.highestVersion != null) {
val highestVersion = v.highestVersion.toString()
val ar = DefaultArtifact(artifact.groupId, artifact.artifactId, artifact.classifier,
artifact.extension, highestVersion)
listOf(AetherResult(ar, request.repositories[0]))
} else {
throw KobaltException("Couldn't resolve range artifact " + artifact)
}
} else {
val dependencyRequest = DependencyRequest(collectRequest(artifact, artifactScope), scopeFilter)
system.resolveDependencies(session, dependencyRequest).artifactResults.map {