Check the API against the last release
Bumpwise compares the library's compiled classes with the version published on Maven Central (or the repository the project uses) and says whether the change breaks existing users, which semantic version is needed, and what the compatible alternative is.
When
- After editing the public API of a library that is published: public or protected classes, methods, fields, constructors, Kotlin parameters and defaults, sealed hierarchies.
- Before committing such a change, and before a release ("what is the next version?", "prepare the release", "write the changelog").
- Not for applications or code that is not published as a library. If Bumpwise says there is no published release yet, say so and stop.
Running Bumpwise
Use the first of these that works:
- The
check_api_compatibilitytool, if abumpwiseMCP server is connected. All its arguments are optional:project(a module folder),exclude(packages that are not API) andincludeChangelog. - The
bumpwisecommand, if it is on the PATH (bumpwise versionprints its version). npx -y @gilware/bumpwisein place ofbumpwise, if Node.js 18 or later is installed. It downloads the same command line once and checks its SHA-256.
All three need Java 17 or later. If none of them is available, tell the user that Bumpwise is not installed and point them to https://gilware.com/bumpwise/cli/. Do not run an installer yourself.
How
- Build the library the way the project is usually built (its README,
CLAUDE.mdorAGENTS.md, CI file or wrapper): compiling is enough, tests are not needed. Bumpwise reads compiled classes, so build again after each edit. - In the library's folder, run
bumpwise check --format markdown. Options:--project DIRfor a module folder in a multi-module build,--exclude PACKAGEfor packages that are not public API (for examplecom.acme.internal), and--changelog(with the default text format) when preparing a release. - Read the exit code: 0 means compatible, 1 breaking changes, 2 that Bumpwise could not check (the output says why).
- Tell the user the result in a few lines: the verdict, the required bump and the next version.
Acting on the result
- Breaking changes found and not intended: change the code to the compatible alternative Bumpwise gives
(for example keep the old method, mark it
@Deprecated, and delegate to the new one), build, and check again until it reports no breaking change. - Breaking on purpose: say that the release needs a new major version, and list what users must change.
- Declared version too low: say which version the project should have. Change the version in the build file only when the user asks.
- Packages reported that are internal: suggest
--exclude, or anexcludelist in.bumpwise.ymlso the whole team gets the same result.
Never commit, tag or publish on your own because the check passed.