Skip to content

Commit dfc738c

Browse files
committed
fix: add repository configuration for Kotlin 2.2.0 dependencies
Adds proper Maven repository configuration to resolve Kotlin 2.2.0 dependencies when building with composite builds or Gradle 9.x. Changes: - Add settings.gradle.kts with pluginManagement to buildSrc/ and gradle/plugins/ - Update buildSrc/build.gradle.kts and gradle/plugins/build.gradle.kts with Maven repos - Update root settings.gradle.kts with pluginManagement and dependencyResolutionManagement This fixes dependency resolution errors when Kotlin 2.2.0+ is not available on the Apache Maven mirror (repo.maven.apache.org) but is available on canonical Maven Central (repo1.maven.org) and JetBrains Kotlin dev repo. Tested with: Elide project composite build integration Verified: Builds successfully with Kotlin 2.2.21 and kotlinx-serialization 1.9.0
1 parent 93f7f9b commit dfc738c

File tree

5 files changed

+94
-1
lines changed

5 files changed

+94
-1
lines changed

buildSrc/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ plugins {
33
}
44

55
repositories {
6+
maven {
7+
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
8+
content {
9+
includeGroupByRegex("org\\.jetbrains.*")
10+
}
11+
}
12+
maven {
13+
url = uri("https://repo1.maven.org/maven2/")
14+
}
615
gradlePluginPortal()
716
}
817

buildSrc/settings.gradle.kts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pluginManagement {
2+
repositories {
3+
maven {
4+
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
5+
content {
6+
includeGroupByRegex("org\\.jetbrains.*")
7+
}
8+
}
9+
maven {
10+
url = uri("https://repo1.maven.org/maven2/")
11+
}
12+
gradlePluginPortal()
13+
}
14+
}
15+
16+
rootProject.name = "buildSrc"

gradle/plugins/build.gradle.kts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

3+
buildscript {
4+
repositories {
5+
maven {
6+
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
7+
content {
8+
includeGroupByRegex("org\\.jetbrains.*")
9+
}
10+
}
11+
maven {
12+
url = uri("https://repo1.maven.org/maven2/")
13+
}
14+
gradlePluginPortal()
15+
}
16+
}
17+
318
plugins {
419
`kotlin-dsl`
520
}
621

722
repositories {
8-
mavenCentral()
23+
maven {
24+
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
25+
content {
26+
includeGroupByRegex("org\\.jetbrains.*")
27+
}
28+
}
29+
maven {
30+
url = uri("https://repo1.maven.org/maven2/")
31+
}
932
gradlePluginPortal()
1033
}
1134

gradle/plugins/settings.gradle.kts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pluginManagement {
2+
repositories {
3+
maven {
4+
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
5+
content {
6+
includeGroupByRegex("org\\.jetbrains.*")
7+
}
8+
}
9+
maven {
10+
url = uri("https://repo1.maven.org/maven2/")
11+
}
12+
gradlePluginPortal()
13+
}
14+
}
15+
16+
rootProject.name = "plugins"

settings.gradle.kts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
1+
pluginManagement {
2+
repositories {
3+
maven {
4+
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
5+
content {
6+
includeGroupByRegex("org\\.jetbrains.*")
7+
}
8+
}
9+
maven {
10+
url = uri("https://repo1.maven.org/maven2/")
11+
}
12+
gradlePluginPortal()
13+
}
14+
}
15+
116
plugins {
217
id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0")
318
}
419

20+
dependencyResolutionManagement {
21+
repositories {
22+
maven {
23+
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
24+
content {
25+
includeGroupByRegex("org\\.jetbrains.*")
26+
}
27+
}
28+
maven {
29+
url = uri("https://repo1.maven.org/maven2/")
30+
}
31+
}
32+
}
33+
534
rootProject.name = "ktoml"
635

736
includeBuild("gradle/plugins")

0 commit comments

Comments
 (0)