From 549ede3ceaf5cf616408791249a05793f11bfb93 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 3 Dec 2015 01:52:05 -0800 Subject: [PATCH] Throw error with docUrl. --- src/main/kotlin/com/beust/kobalt/maven/Kurl.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt b/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt index b7922bac..683536a7 100644 --- a/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt +++ b/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt @@ -33,10 +33,14 @@ class Kurl(val hostInfo: HostConfig) { hostInfo.password = properties.getProperty(key) } } + fun error(s1: String, s2: String) { + throw KobaltException("Found \"$s1\" but not \"$s2\" in local.properties for $KEY.$host", + docUrl = "http://beust.com/kobalt/documentation/index.html#maven-repos-authenticated") + } if (! hostInfo.username.isNullOrBlank() && hostInfo.password.isNullOrBlank()) { - throw KobaltException("Found \"username\" but not \"password\" in local.properties for $KEY.$host") + error("username", "password") } else if(hostInfo.username.isNullOrBlank() && ! hostInfo.password.isNullOrBlank()) { - throw KobaltException("Found \"password\" but not \"username\" in local.properties for $KEY.$host") + error("password", "username") } }