Skip to content

Commit 520fcb5

Browse files
connor4312Copilot
andauthored
kotlin: redirect plugin marker resolution to maven artifacts (#176)
The ESRP-backed ADO publish environment uses an internal Maven mirror (Azure Artifacts feed) that doesn't sync the tiny `<plugin-id>.gradle.plugin` marker POMs the Gradle Plugin Portal uses to redirect to real artifacts. Result: `./gradlew check` fails with 'Plugin [id: org.jetbrains.kotlin.jvm, version: 2.3.21] was not found' even though kotlin-gradle-plugin is in the mirror. Add a pluginManagement.resolutionStrategy.eachPlugin block that maps the Kotlin and Vanniktech plugin IDs directly to their Maven coordinates, bypassing the marker artifact entirely. GHA still resolves via plugin portal normally. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e1cb40e commit 520fcb5

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

clients/kotlin/settings.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ pluginManagement {
33
gradlePluginPortal()
44
mavenCentral()
55
}
6+
// Redirect Gradle plugin marker requests to the actual Maven
7+
// coordinates so plugin resolution works even when the build
8+
// environment's Maven mirror (e.g. an internal Azure Artifacts feed
9+
// used by ESRP-backed publish runs) doesn't have the tiny
10+
// `<plugin-id>.gradle.plugin` redirect POMs synced. The real
11+
// artifacts live in mavenCentral and are always mirrored.
12+
resolutionStrategy {
13+
eachPlugin {
14+
when (requested.id.id) {
15+
"org.jetbrains.kotlin.jvm",
16+
"org.jetbrains.kotlin.plugin.serialization" ->
17+
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
18+
"com.vanniktech.maven.publish" ->
19+
useModule("com.vanniktech:gradle-maven-publish-plugin:${requested.version}")
20+
}
21+
}
22+
}
623
}
724

825
dependencyResolutionManagement {

0 commit comments

Comments
 (0)