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

Better error message.

This commit is contained in:
Cedric Beust 2017-04-24 16:04:20 -07:00
parent 4a5a6442ec
commit 5b1c9150a5

View file

@ -76,9 +76,13 @@ class KobaltMavenResolver @Inject constructor(val settings: KobaltSettings,
val artifact = DefaultArtifact(mavenId) val artifact = DefaultArtifact(mavenId)
val request = VersionRangeRequest(artifact, createRepos(repos), null) val request = VersionRangeRequest(artifact, createRepos(repos), null)
val rr = system.resolveVersionRange(session, request) val rr = system.resolveVersionRange(session, request)
val newArtifact = DefaultArtifact(artifact.groupId, artifact.artifactId, artifact.classifier, if (rr.highestVersion != null) {
artifact.extension, rr.highestVersion.toString()) val newArtifact = DefaultArtifact(artifact.groupId, artifact.artifactId, artifact.classifier,
artifactToId(newArtifact) artifact.extension, rr.highestVersion.toString())
artifactToId(newArtifact)
} else {
throw KobaltException("Couldn't resolve $passedId")
}
} else { } else {
passedId passedId
} }