'Configuration with name 'integrationTestCompile' not found

when trying to upgrade my gradle version from 5.x to 7.x, getting below error


* What went wrong:
Configuration with name 'integrationTestCompile' not found.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

Below is my code

sourceSets {
    create("integrationTest") {
        compileClasspath += sourceSets.main.get().output
        runtimeClasspath += sourceSets.main.get().output
        runtimeClasspath += sourceSets.test.get().output
    }
}

val integrationTestCompile: Configuration by configurations.getting {
    extendsFrom(configurations.testImplementation.get())
}
val integrationTestRuntimeOnly: Configuration by configurations.getting {
    extendsFrom(configurations.testRuntimeOnly.get())
}

tasks {
    val integrationTest by creating(Test::class) {
        description = "Running integration tests."
        group = "verification"

        testClassesDirs = sourceSets["integrationTest"].output.classesDirs
        classpath = sourceSets["integrationTest"].runtimeClasspath
        shouldRunAfter("test")
    }
}

Using gradle with kotlin.

How to fix this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source