From d5275aaf07a3149a4d263ee4b768c7adcac25400 Mon Sep 17 00:00:00 2001 From: Ilya Muradyan Date: Tue, 9 Nov 2021 16:31:32 +0300 Subject: [PATCH 1/2] Mark packages for relocation to fix classpath interferring in main-kts ^KT-49476 fixed (cherry picked from commit 56d472451cb9ae5f8322ae59023bd868bd9ad0fd) --- .../scripting/dependencies-maven-all/build.gradle.kts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/scripting/dependencies-maven-all/build.gradle.kts b/libraries/scripting/dependencies-maven-all/build.gradle.kts index 0ecb543e253aa..0635ed2cd65e3 100644 --- a/libraries/scripting/dependencies-maven-all/build.gradle.kts +++ b/libraries/scripting/dependencies-maven-all/build.gradle.kts @@ -42,6 +42,11 @@ noDefaultJar() sourcesJar() javadocJar() +val mavenPackagesToRelocate = listOf( + "org.eclipse", + "org.codehaus" +) + val relocatedJar by task { configurations = listOf(embedded) duplicatesStrategy = DuplicatesStrategy.INCLUDE @@ -51,7 +56,7 @@ val relocatedJar by task { transform(ComponentsXmlResourceTransformerPatched()) if (kotlinBuildProperties.relocation) { - packagesToRelocate.forEach { + (packagesToRelocate + mavenPackagesToRelocate).forEach { relocate(it, "$kotlinEmbeddableRootPackage.$it") } } From 583488e3cecfc3890ba845d86ef5cc16e340ff7f Mon Sep 17 00:00:00 2001 From: Ilya Muradyan Date: Thu, 11 Nov 2021 11:24:49 +0300 Subject: [PATCH 2/2] [scripting] Fix NPE in aether.kt (cherry picked from commit 57543f5b199547af8e3ba09e98db480359c06318) --- .../script/experimental/dependencies/maven/impl/aether.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/scripting/dependencies-maven/src/kotlin/script/experimental/dependencies/maven/impl/aether.kt b/libraries/scripting/dependencies-maven/src/kotlin/script/experimental/dependencies/maven/impl/aether.kt index b866c627588fc..268bd7846494c 100644 --- a/libraries/scripting/dependencies-maven/src/kotlin/script/experimental/dependencies/maven/impl/aether.kt +++ b/libraries/scripting/dependencies-maven/src/kotlin/script/experimental/dependencies/maven/impl/aether.kt @@ -245,7 +245,7 @@ internal class AetherResolveSession( ): Settings { var main = result.effectiveSettings val files = File(System.getProperty("user.dir")) - .parentFile.listFiles( + .parentFile?.listFiles( NameFileFilter("interpolated-settings.xml") as FileFilter ) val settingsFile = files?.singleOrNull()