You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-1
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,55 @@ See the [documentation](https://gradlex.org/jvm-dependency-conflict-resolution/)
27
27
Note: There are rules in this plugin (in particular for _Guava_) which work _better_ with Gradle `7+`.
28
28
This is because Gradle 7 added support for the `org.gradle.jvm.environment` attribute that allows Gradle to better distinguish between _standard-jvm_ and _android_ projects.
29
29
30
-
### Notes on the Plugins history
30
+
## Contributing new capability rules
31
+
32
+
This plugin collects information for libraries available on Maven Central to allow capability conflict detection.
33
+
If you discover that information is missing, we appreciate a contribution to the plugin.
34
+
An indication that such information is missing, is that you have duplicated classes on your classpath although this plugin is active.
35
+
36
+
### (1) Use patch DSL to add rule in your build
37
+
38
+
You can use the [patch DSL](https://gradlex.org/jvm-dependency-conflict-resolution/#patch-dsl-block) to add the missing rule without modifying the plugin. Do this first and verify that it behaves as expected:
39
+
40
+
```kotlin
41
+
// Assuming 'org.example:name' and 'org.example.new:new-name' are in conflict
Once you confirmed that the rule is working as expected, you can open a PRinthis repository to contribute your findings back to the plugin.
55
+
Thisis done as follows:
56
+
57
+
1. Add a new entry to the [CapabilityDefinition](https://github.com/gradlex-org/jvm-dependency-conflict-resolution/blob/main/src/main/java/org/gradlex/jvm/dependency/conflict/detection/rules/CapabilityDefinition.java) enum.
58
+
You can use the [ASM](https://github.com/gradlex-org/jvm-dependency-conflict-resolution/blob/main/src/main/java/org/gradlex/jvm/dependency/conflict/detection/rules/CapabilityDefinition.java#L69-L72) entry as orientation.
59
+
2. Run the `JarOverlapTest`.
60
+
The test will tell you that you need to add dependencies to `samples/sample-all/build.gradle.kts` and `samples/sample-all-deactivated/build.gradle.kts`.
61
+
Lookup the latest versions of the dependencies and add them to the files.
62
+
Thisis so that the plugin's test suite can automatically verify that the new entry is valid in the sense that the Jars overlap.
63
+
Make sue `JarOverlapTest` passes after you made the changes.
64
+
3. Run the `SamplesTest`.
65
+
It will tell you that `samples/sample-all/build.out` and `samples/sample-all-deactivated/build.out` do not have the expected content.
66
+
Update these files accordingly (you may copy the new expected output from the failed test's output).
67
+
Thisis the output of Gradle's `dependencies` task. Check that the changes are what you would expect.
68
+
Make sue `SamplesTest` passes after you made the changes.
0 commit comments