Summary
Add automated API compatibility checking to CI to detect source-incompatible
and binary-incompatible changes before they are released.
Motivation
In 1.5.0, PR #1800 changed MetricWithFixedMetadata.getMetadata() from
protected to public — a source-incompatible change that was not caught
during review (see #1897).
Tools to add
Both are used by OpenTelemetry Java
and complement each other:
- japicmp — Maven plugin that
compares two versions of a JAR and reports binary/source incompatibilities.
Catches changes like visibility narrowing, method removal, signature
changes, etc.
- Animal Sniffer — checks
that code only uses APIs from a defined API signature. Useful for enforcing
a stable public API baseline.
Acceptance criteria