@@ -91,14 +91,45 @@ 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+ - Suggestions for muzzle version ranges based on breaking changes
112+
113+ #### Usage
114+
115+ Compare two versions of any Maven artifact:
116+
117+ ``` shell
118+ ./gradlew japicmp -Partifact=groupId:artifactId -Pbaseline=oldVersion -Ptarget=newVersion
119+ ```
120+
121+ For example, to compare MongoDB driver versions:
122+
123+ ``` shell
124+ ./gradlew japicmp -Partifact=org.mongodb:mongodb-driver-sync -Pbaseline=3.11.0 -Ptarget=4.0.0
125+ ```
126+
127+ #### Output
128+
129+ The task generates two reports:
130+
131+ - ** Text report** : ` build/reports/japicmp.txt ` - Detailed line-by-line comparison
132+ - ** HTML report** : ` build/reports/japicmp.html ` - Browsable visual report
102133
103134## Instrumentation classes
104135
0 commit comments