From 44fa2945460988b0312e8c976d9d5107da28c01e Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Fri, 26 Feb 2016 23:06:04 +0400 Subject: [PATCH] Fix for https://github.com/cbeust/kobalt/issues/138 --- .../src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt | 4 ++-- .../src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt index a65432f8..f6afc72f 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt @@ -27,7 +27,7 @@ public class DepFactory @Inject constructor(val localRepo: LocalRepo, * Parse the id and return the correct IClasspathDependency */ fun create(id: String, downloadSources: Boolean = false, downloadJavadocs: Boolean = false, - localFirst : Boolean = true, executor: ExecutorService = defExecutor) + localFirst : Boolean = true, showNetworkWarning: Boolean = true, executor: ExecutorService = defExecutor) : IClasspathDependency { if (id.startsWith(FileDependency.PREFIX_FILE)) { return FileDependency(id.substring(FileDependency.PREFIX_FILE.length)) @@ -46,7 +46,7 @@ public class DepFactory @Inject constructor(val localRepo: LocalRepo, if (localFirst && localVersion != null) { localVersion } else { - if (! localFirst) { + if (! localFirst && showNetworkWarning) { warn("The id \"$id\" doesn't contain a version, which will cause a network call") } repoResult = remoteRepo.findCorrectRepo(id) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt index fbcbbecc..bd8df089 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt @@ -23,7 +23,7 @@ public class CheckVersions @Inject constructor(val depFactory : DepFactory, if (MavenId.isMavenId(compileDependency.id)) { try { val dep = depFactory.create(compileDependency.shortId, localFirst = false, - executor = executor) + showNetworkWarning = false, executor = executor) if (dep is MavenDependency) { val other = compileDependency as MavenDependency if (dep.id != compileDependency.id