diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt index 683536a7..bc8015ce 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt @@ -66,7 +66,7 @@ class Kurl(val hostInfo: HostConfig) { if (connection is HttpURLConnection) { val responseCode = (connection as HttpURLConnection).responseCode checkResponseCode(responseCode) - responseCode == 200 + responseCode == 200 || responseCode == 301 } else if (url.startsWith(FileDependency.PREFIX_FILE)) { val fileName = url.substring(FileDependency.PREFIX_FILE.length) File(fileName).exists() diff --git a/src/test/kotlin/com/beust/kobalt/maven/DownloadTest.kt b/src/test/kotlin/com/beust/kobalt/maven/DownloadTest.kt index 3922c0d4..9d245b40 100644 --- a/src/test/kotlin/com/beust/kobalt/maven/DownloadTest.kt +++ b/src/test/kotlin/com/beust/kobalt/maven/DownloadTest.kt @@ -17,7 +17,8 @@ import kotlin.properties.Delegates /** * TODO: test snapshots https://repository.jboss.org/nexus/content/repositories/root_repository//commons-lang/commons-lang/2.7-SNAPSHOT/commons-lang-2.7-SNAPSHOT.jar */ -public class DownloadTest @Inject constructor( +@Test +class DownloadTest @Inject constructor( val depFactory: DepFactory, val localRepo: LocalRepo, val executors: KobaltExecutors) : KobaltTest() { @@ -134,5 +135,10 @@ public class DownloadTest @Inject constructor( Assert.assertTrue(Kurl(HostConfig(url)).exists, "Should exist: $url") } + @Test + fun jitpackTest() { + val id = "http://jitpack.io/com/github/JakeWharton/RxBinding/rxbinding-kotlin/542cd7e8a4/rxbinding-kotlin-542cd7e8a4.aar" + Assert.assertTrue(Kurl(HostConfig(id)).exists) + } }