From 3df9e4ad1c7d05c82e3abc83d0a4ad93260a0c5a Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Mon, 21 Mar 2016 22:00:33 +0400 Subject: [PATCH] Don't return snapshots for versionless id's. --- .../src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt index a27adf07..cfa80e6b 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt @@ -115,7 +115,8 @@ class RepoFinder @Inject constructor(val executors: KobaltExecutors, val localRe val isLocal = repoUrl.startsWith(FileDependency.PREFIX_FILE) val path = ud.toMetadataXmlPath(false, isLocal) val foundVersion = findCorrectVersionRelease(path, repoUrl) - if (foundVersion != null) { + // When looking up a versionless id, never return a SNAPSHOT + if (foundVersion != null && ! foundVersion.contains("SNAPSHOT")) { return listOf(RepoResult(repo, Version.of(foundVersion), repoUrl + path)) } else { return listOf(RepoResult(repo))