Skip to content

build: depend on the Kotlin and detekt Gradle plugin artifacts instead of their markers - #305

Open
sergej-koscejev wants to merge 1 commit into
mainfrom
build/plugin-artifacts-not-markers
Open

sergej-koscejev wants to merge 1 commit into
mainfrom
build/plugin-artifacts-not-markers

Conversation

@sergej-koscejev

@sergej-koscejev sergej-koscejev commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

build-logic depended on the plugin marker modules of the Kotlin and detekt Gradle plugins. A marker has pom packaging, so Gradle also asks for an optional .jar, which does not exist. Gradle caches the 404 for only 24 hours, so every CI job that restores an older Gradle user home asks Maven Central again. When Maven Central answers 429 or 403 instead of 404, configuring :daemon fails (runs 44124256664, 44134812584, 44608914710).

build-logic now depends on the plugin artifacts themselves, at the same versions:

Catalog alias (old → new) Module (old → new)
kotlin-gradle-plugin-marker → kotlin-gradle-plugin org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin → org.jetbrains.kotlin:kotlin-gradle-plugin
detekt-gradle-plugin-marker → detekt-gradle-plugin dev.detekt:dev.detekt.gradle.plugin → dev.detekt:detekt-gradle-plugin

Nothing else used the marker aliases. Both entries keep version.ref = "kotlin" and version.ref = "detekt", so Renovate updates them together with the plugins and .github/renovate.json5 needs no change.

Evidence

./gradlew --refresh-dependencies --debug help, requests that Gradle logged as Resource missing:

  • Before (origin/main): 14 misses. Two are marker jars on Maven Central, the URLs from the failed runs:

    GET https://repo.maven.apache.org/maven2/dev/detekt/dev.detekt.gradle.plugin/2.0.0-alpha.6/dev.detekt.gradle.plugin-2.0.0-alpha.6.jar
    GET https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/jvm/org.jetbrains.kotlin.jvm.gradle.plugin/2.4.21/org.jetbrains.kotlin.jvm.gradle.plugin-2.4.21.jar
    

    After: 11 misses, none of them a *.gradle.plugin-*.jar on Maven Central. The detekt marker jar request to the Gradle Plugin Portal (from build-logic:compileClasspath) is gone as well.

./gradlew assemble compileTestKotlin detektMain :architecture-tests:test passes.

The root plugins { alias(libs.plugins.kotlin.jvm) apply false } also asks for a marker jar, but from the Gradle Plugin Portal, not from Maven Central. Gradle does this for every plugin that a plugins {} block resolves by ID and version, 7 requests in all, unchanged by this PR. Avoiding them would mean putting those plugins on the build-logic classpath instead, which is a larger change. No CI failure has come from the portal.

Merge Danger

Blast Radius: Build

Only the build classpath of build-logic changes. The plugins and their versions are the same.

Where to look

  • gradle/libs.versions.toml: the new alias names kotlin-gradle-plugin and detekt-gradle-plugin.

Left for later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant