Skip to content

REPLicated/classpath-collision-detector

Repository files navigation

Build Status Download

Gradle Classpath Collision Detector

Gradle plugin to detect potential classpath collisions between library jars.

Fails the build whenever an unexpected duplicate entry is found in two or more artifacts.

Usage

The plugin requires Gradle 6.6 or newer.

You can apply the plugin with the plugins block

plugins {
    id("io.fuchs.gradle.classpath-collision-detector") version "1.0.0"
}

Then run ./gradlew detectCollisions to run the detection.

If the project also applies the java plugin the task searches the runtimeClasspath for collisions.

Customization

You can also explicitly specify the configuration

tasks.named<DetectCollisionsTask>("detectCollisions").configure {
    configurations.from(project.configurations.runtimeClasspath)
}

To ignore certain conflicts you can add exclude patterns that match collisions you are not interested in e.g.

tasks.named<DetectCollisionsTask>("detectCollisions").configure {
    collisionFilter {
        exclude("**.html", "**.txt", "**.properties")
    }
}

About

A Gradle plugin to detect potential classpath collisions between library jars.

Resources

License

Stars

Watchers

Forks

Packages

No packages published