Check a dependency upgrade
Bumpwise compares the version of a dependency the project uses now with the new one, and finds each breaking change in the project's compiled classes: the places (file:line) that will stop compiling or fail at run time.
Running Bumpwise
Use the first of these that works:
- The
check_dependency_upgradetool, if abumpwiseMCP server is connected. Its arguments:dependency(GROUP:ARTIFACT),to(the new version; leave it out for the latest release) andproject(a module folder). - 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 project the way it is usually built, before changing the version: Bumpwise reads the compiled classes, and the version the project uses now from
pom.xml,build.gradle(.kts)orgradle/libs.versions.toml. -
Check the upgrade:
- one dependency:
bumpwise upgrade GROUP:ARTIFACT:VERSION(leave out:VERSIONfor the latest release); - every version a branch changed (a Dependabot or Renovate pull request):
bumpwise upgrade --changed-since origin/main.
In a multi-module build, add
--project DIRfor one module, or leave it out to scan every module's build output. Add--from Vonly when Bumpwise cannot read the version used now.--format jsongives output to parse. - one dependency:
-
Read the exit code: 0 means safe for this project, 1 that it breaks places in it, 2 that Bumpwise could not tell (the output says why).
-
Tell the user the verdict and the places it lists. Each place names the method, field or class that changed and, for a moved class, where it went.
Acting on the result
- Safe: change the version.
- Breaks places: change the version and fix each listed place (a moved class: the new name; a removed method: look in the new version's API or release notes for the replacement). Build again and run the tests.
- Marked source only: compiled code still runs, but recompiling fails; fix it the same way.
- Raises minSdk (Android libraries): the new version needs a higher minSdk than the project's, so the build fails at the manifest merge. Tell the user; raising the app's minSdk drops older devices, so it is their decision. Otherwise stay on the current version. If Bumpwise could not read the project's minSdk, say which minSdk the new version needs.
- A BOM (
androidx.compose:compose-bom, Firebase'scom.google.firebase:firebase-bom,org.springframework.boot:spring-boot-dependencies): pass the BOM itself as the dependency. The answer starts with a line about the BOM (how many of the project's libraries change version), then gives one result per library it moves. Where the build sets its own version of one of those libraries, Bumpwise checks the version the build will use. A library marked "cannot tell" (Bumpwise could not read its version, or the build changes how Gradle picks versions) needs a check of its own with itsGROUP:ARTIFACT.
Bumpwise does not see uses through reflection or code that is not compiled, and it only checks the dependency itself, not the other dependencies its new version brings in.