File tree 1 file changed +51
-0
lines changed
1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ ![ Gradle Plugin Portal] ( https://img.shields.io/gradle-plugin-portal/v/io.fuchs.gradle.classpath-collision-detector )
2
+
1
3
# Gradle Classpath Collision Detector
2
4
3
5
Experimental Gradle plugin to detect potential classpath collisions between library jars.
4
6
5
7
Fails the build whenever an unexpected duplicate entry is found in more than one artifact.
8
+
9
+ ## Usage
10
+
11
+ The plugin requires Gradle 6.6 or newer.
12
+
13
+ You can either apply the plugin with the plugins block
14
+ ``` groovy
15
+ plugins {
16
+ id "io.fuchs.gradle.classpath-collision-detector" version "0.3"
17
+ }
18
+ ```
19
+ or using the legacy version
20
+ ``` groovy
21
+ buildscript {
22
+ repositories {
23
+ maven {
24
+ url "https://plugins.gradle.org/m2/"
25
+ }
26
+ }
27
+ dependencies {
28
+ classpath "io.fuchs.gradle.classpath-collision-detector:classpath-collision-detector:0.3"
29
+ }
30
+ }
31
+
32
+ apply plugin: "io.fuchs.gradle.classpath-collision-detector"
33
+ ```
34
+
35
+ Then run ` ./gradlew detectCollisions ` to run the detection.
36
+
37
+ If the projet also applies the ` java ` plugin the task searches the ` runtimeClasspath ` for collisions.
38
+
39
+ ### Customization
40
+
41
+ You can also explicitly specify the configuration
42
+ ``` groovy
43
+ tasks.named('detectCollisions', DetectCollisionsTask).configure {
44
+ configurations.from(project.configurations.runtimeClasspath)
45
+ }
46
+ ```
47
+
48
+ To ignore certain conflicts you can add exclude patterns that match collisions you are not interrested in e.g.
49
+
50
+ ``` groovy
51
+ tasks.named('detectCollisions', DetectCollisionsTask).configure {
52
+ collisionFilter {
53
+ exclude('**.html', '**.txt', '**.properties')
54
+ }
55
+ }
56
+ ```
You can’t perform that action at this time.
0 commit comments