@@ -91,14 +91,44 @@ To run muzzle on your instrumentation, run:
9191
9292> [ !WARNING]
9393> Muzzle does _ not_ run tests.
94- > It checks that the types and methods used by the instrumentation are present in particular versions of libraries.
95- > It can be subverted with ` MethodHandle ` and reflection -- in other words, having the ` muzzle ` task passing is not enough
94+ > It checks that the types and methods used by the instrumentation are present in particular versions of libraries.
95+ > It can be subverted with ` MethodHandle ` and reflection -- in other words, having the ` muzzle ` task passing is not enough
9696> to validate an instrumentation.
9797
9898By default, all the muzzle directives are checked against all the instrumentations included in a module.
99- However, there can be situations in which it’ s only needed to check one specific directive on an instrumentation.
99+ However, there can be situations in which it' s only needed to check one specific directive on an instrumentation.
100100At this point the instrumentation should override the method ` muzzleDirective() ` by returning the name of the directive to execute.
101101
102+ ### Identifying Breaking Changes with JApiCmp
103+
104+ Before defining muzzle version ranges, you can use the JApiCmp plugin to compare different versions of a library and
105+ identify breaking API changes. This helps determine where to split version ranges in your muzzle directives.
106+
107+ The ` japicmp ` task compares two versions of a Maven artifact and reports:
108+ - Removed classes and methods (breaking changes)
109+ - Added classes and methods (non-breaking changes)
110+ - Modified methods with binary compatibility status
111+
112+ #### Usage
113+
114+ Compare two versions of any Maven artifact:
115+
116+ ``` shell
117+ ./gradlew japicmp -Partifact=groupId:artifactId -Pbaseline=oldVersion -Ptarget=newVersion
118+ ```
119+
120+ For example, to compare MongoDB driver versions:
121+
122+ ``` shell
123+ ./gradlew japicmp -Partifact=org.mongodb:mongodb-driver-sync -Pbaseline=3.11.0 -Ptarget=4.0.0
124+ ```
125+
126+ #### Output
127+
128+ The task generates two reports:
129+
130+ - ** Text report** : ` build/reports/japicmp.txt ` - Detailed line-by-line comparison
131+ - ** HTML report** : ` build/reports/japicmp.html ` - Browsable visual report
102132
103133## Instrumentation classes
104134
0 commit comments