diff --git a/buildSrc/src/main/kotlin/mcdev.gradle.kts b/buildSrc/src/main/kotlin/mcdev.gradle.kts index c53450d64..99a58e2eb 100644 --- a/buildSrc/src/main/kotlin/mcdev.gradle.kts +++ b/buildSrc/src/main/kotlin/mcdev.gradle.kts @@ -22,6 +22,7 @@ import com.google.gson.Gson import com.google.gson.GsonBuilder import com.google.gson.reflect.TypeToken import java.net.HttpURLConnection +import java.net.URI import java.net.URL import java.util.Properties import java.util.zip.ZipFile @@ -94,7 +95,7 @@ tasks.register("resolveIntellijLibSources") { val groupPath = dep.groupId.replace('.', '/') val (_, artifact, ver) = dep val url = "https://repo.maven.apache.org/maven2/$groupPath/$artifact/$ver/$artifact-$ver-sources.jar" - return@filter with(URL(url).openConnection() as HttpURLConnection) { + return@filter with(URI.create(url).toURL().openConnection() as HttpURLConnection) { try { requestMethod = "GET" val code = responseCode diff --git a/src/main/kotlin/util/HttpConnectionFactory.kt b/src/main/kotlin/util/HttpConnectionFactory.kt index ab0fed035..9b2ed87ba 100644 --- a/src/main/kotlin/util/HttpConnectionFactory.kt +++ b/src/main/kotlin/util/HttpConnectionFactory.kt @@ -22,10 +22,10 @@ package com.demonwav.mcdev.util import com.intellij.util.net.HttpConfigurable import java.net.HttpURLConnection -import java.net.URL +import java.net.URI sealed class HttpConnectionFactory { - open fun openHttpConnection(url: String) = URL(url).openConnection() as HttpURLConnection + open fun openHttpConnection(url: String) = URI.create(url).toURL().openConnection() as HttpURLConnection } object ProxyHttpConnectionFactory : HttpConnectionFactory() {