diff --git a/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt b/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt index 034bf176..59a9ba94 100644 --- a/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt +++ b/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt @@ -1,9 +1,10 @@ package com.beust.kobalt.misc +import com.beust.kobalt.KobaltException import com.beust.kobalt.api.Project import com.beust.kobalt.maven.DepFactory -import com.beust.kobalt.maven.dependency.MavenDependency import com.beust.kobalt.maven.MavenId +import com.beust.kobalt.maven.dependency.MavenDependency import javax.inject.Inject /** @@ -20,13 +21,17 @@ public class CheckVersions @Inject constructor(val depFactory : DepFactory, arrayListOf(it.compileDependencies, it.testDependencies).forEach { cds -> cds.forEach { compileDependency -> if (MavenId.isMavenId(compileDependency.id)) { - val dep = depFactory.create(compileDependency.shortId, executor, false /* go remote */) - if (dep is MavenDependency) { - val other = compileDependency as MavenDependency - if (dep.id != compileDependency.id - && Versions.toLongVersion(dep.version) > Versions.toLongVersion(other.version)) { - newVersions.add(dep.id) + try { + val dep = depFactory.create(compileDependency.shortId, executor, false /* go remote */) + if (dep is MavenDependency) { + val other = compileDependency as MavenDependency + if (dep.id != compileDependency.id + && Versions.toLongVersion(dep.version) > Versions.toLongVersion(other.version)) { + newVersions.add(dep.id) + } } + } catch(e: KobaltException) { + log(1, "cannot resolve ${compileDependency.shortId}. ignoring") } } }