Scripting: avoid CME in maven resolving in IDE scenarios
combination of laziness in AetherResolveSession and possibly async-modifiable repos collection in MavenDependenciesResolver may lead to the CME. #KT-54733 fixed
This commit is contained in:
+1
-1
@@ -43,7 +43,7 @@ class MavenDependenciesResolver : ExternalDependenciesResolver {
|
||||
|
||||
val repos: ArrayList<RemoteRepository> = arrayListOf()
|
||||
|
||||
private fun remoteRepositories() = if (repos.isEmpty()) arrayListOf(mavenCentral) else repos
|
||||
private fun remoteRepositories() = if (repos.isEmpty()) arrayListOf(mavenCentral) else repos.toList() // copy to avoid sharing problems
|
||||
|
||||
private fun String.toMavenArtifact(): DefaultArtifact? =
|
||||
if (this.isNotBlank() && this.count { it == ':' } >= 2) DefaultArtifact(this)
|
||||
|
||||
Reference in New Issue
Block a user