plugins {
    java
}

repositories {
    mavenCentral()
}

// tag::exclude-transitive-dependencies[]
configurations {
    "implementation" {
        exclude(group = "commons-collections", module = "commons-collections")
    }
}

dependencies {
    implementation("commons-beanutils:commons-beanutils:1.9.4")
    implementation("com.opencsv:opencsv:4.6")
}
// end::exclude-transitive-dependencies[]

tasks.register("printArtifacts") {
    val runtimeClasspath: FileCollection = configurations["runtimeClasspath"]
    doLast {
        runtimeClasspath.forEach { println(it.name) }
    }
}

plugins {
    java
}

repositories {
    mavenCentral()
}

// tag::exclude-transitive-dependencies[]
configurations {
    "implementation" {
        exclude(group = "commons-collections", module = "commons-collections")
    }
}

dependencies {
    implementation("commons-beanutils:commons-beanutils:1.9.4")
    implementation("com.opencsv:opencsv:4.6")
}
// end::exclude-transitive-dependencies[]

tasks.register("printArtifacts") {
    val runtimeClasspath: FileCollection = configurations.runtimeClasspath.get()
    doLast {
        runtimeClasspath.forEach { println(it.name) }
    }
}

Adjust the snippet for configuration cache
Adjust the snippet for configuration cache

Signed-off-by: Siddardha Bezawada <f10b77d646d3c88d3a85e0d0f19dd81d5483a9d0@gmail.com>

gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle