Skip to content

Kotlin 2.2.0 incompatibility with buildSrc #2145

@maczikasz

Description

@maczikasz

Library Version
Gradle plugin 9.0.0.-alpha8

Describe the bug
When the plugin is added as a depdenency to a convention plugin then the applicaiton of the kotlin plugin fails

To Reproduce
Create the files, run gradle build

1. settings.gradle.kts

// Minimal reproducible example for bug ticket
rootProject.name = "kotlin-gradle9"

// Include buildSrc with graphql-kotlin plugin
pluginManagement {
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
}

2. build.gradle.kts

// Minimal reproducible example for bug ticket
// Gradle version: 9.2.0
// Kotlin version: 2.2.20

plugins {
    kotlin("jvm") version "2.2.20"
}

repositories {
    mavenCentral()
}

dependencies {
    implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
    testImplementation("org.jetbrains.kotlin:kotlin-test")
    testImplementation("org.junit.jupiter:junit-jupiter-api")
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}

java {
    sourceCompatibility = JavaVersion.VERSION_21
    targetCompatibility = JavaVersion.VERSION_21
}

tasks.test {
    useJUnitPlatform()
}

buildSrc/build.gradle.kts

// buildSrc configuration for bug ticket reproduction
plugins {
    `kotlin-dsl`
}

repositories {
    mavenCentral()
    gradlePluginPortal()
}

dependencies {
    implementation(gradleApi())
    implementation("com.expediagroup:graphql-kotlin-gradle-plugin:9.0.0-alpha.8")
}

Expected behavior
not fail

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions