This document provides comprehensive examples for using omnibump with different language ecosystems.
# Update golang.org/x/sys to latest
omnibump --language go --packages "golang.org/x/sys@latest" --tidyCreate deps.yaml:
# language field is optional - will auto-detect
packages:
- name: golang.org/x/sys
version: v0.28.0
- name: golang.org/x/crypto
version: v0.31.0
- name: github.com/spf13/cobra
version: v1.10.1Run update:
omnibump --deps deps.yaml --tidyCreate deps.yaml:
language: go
packages:
- name: golang.org/x/net
version: v0.32.0
replaces:
- oldName: github.com/old/package
name: github.com/new/package
version: v2.0.0Run update:
omnibump --deps deps.yamlFor projects using go.work:
# omnibump automatically detects and updates go.work
omnibump --deps deps.yaml --tidy# Basic analysis
omnibump analyze .
# Check if specific version is already current
omnibump analyze --packages "golang.org/x/sys@latest"Go modules with major version >= 2 that don't have /vN in their path require the +incompatible suffix. Omnibump handles this automatically:
# You specify without +incompatible
omnibump --packages "github.com/docker/docker@v28.0.0"
# Omnibump automatically resolves to canonical form
# Output: Resolved github.com/docker/docker@v28.0.0 to canonical form v28.0.0+incompatible
# Works with multiple packages
omnibump --packages "github.com/docker/docker@v28.0.0 github.com/docker/cli@v29.2.0"
# Both get +incompatible added automaticallyWhy this matters:
- Without automatic resolution, you'd get:
version "v28.0.0" invalid: should be v0 or v1, not v28 - Omnibump queries the Go proxy to get the correct canonical version
- No need to remember which packages need
+incompatible
Omnibump automatically detects when updating a package requires co-updating other dependencies:
# Try to update a single package
omnibump --packages "oras.land/oras-go@v1.2.7"
# Omnibump detects incompatibilities and provides guidance
# Output:
# Error: the following dependencies need to be co-updated:
# - github.com/docker/docker: current v28.0.0, required >= v28.5.1
# - github.com/docker/cli: current v25.0.1, required >= v28.5.1
# - golang.org/x/crypto: current v0.41.0, required >= v0.43.0
# [... more dependencies ...]
#
# To proceed, add these packages to your update:
# omnibump --packages "oras.land/oras-go@v1.2.7 github.com/docker/docker@v28.5.1 github.com/docker/cli@v28.5.1 ..."
# Run the suggested command
omnibump --packages "oras.land/oras-go@v1.2.7 github.com/docker/docker@v28.5.1 github.com/docker/cli@v28.5.1 golang.org/x/crypto@v0.43.0 ..."
# All packages updated successfully, build will workWhy this matters:
- Prevents build failures from incompatible dependency versions
- Saves time debugging type mismatch errors
- Provides exact command to run - no trial and error
- Validates entire update set together
How it works:
- Fetches target version's go.mod from Go module proxy
- Compares its requirements against your current versions
- Detects packages where
current < required - Provides complete list of co-updates needed
See Transitive Dependency Detection for detailed documentation.
Create deps.yaml:
# language field is optional - will auto-detect
packages:
- name: tokio
version: 1.42.0
- name: serde
version: 1.0.217
- name: serde_json
version: 1.0.135Run update:
omnibump --deps deps.yamlSome Rust projects benefit from running cargo update first:
# Run cargo update before applying specific version pins
omnibump --deps deps.yaml --tidyFor packages with multiple versions in Cargo.lock:
language: rust
packages:
# Update specific version of syn
- name: syn
version: 2.0.90omnibump --deps deps.yaml# Quick inline update
omnibump --language rust --packages "tokio@1.42.0 serde@1.0.217"# See all dependencies in Cargo.lock
omnibump analyze .
# Check for version conflicts
omnibump analyze --output json > analysis.jsonCreate deps.yaml:
# language field is optional - will auto-detect
packages:
- groupId: io.netty
artifactId: netty-codec-http
version: 4.1.94.Final
- groupId: org.slf4j
artifactId: slf4j-api
version: 2.0.16
- groupId: junit
artifactId: junit
version: 4.13.2
scope: testRun update:
omnibump --deps deps.yamlFor dependencies that use Maven properties like ${slf4j.version}:
Create properties.yaml:
properties:
- property: slf4j.version
value: 2.0.16
- property: netty.version
value: 4.1.94.Final
- property: junit.version
value: 4.13.2Run update:
omnibump --properties properties.yaml# Update both properties and direct dependencies
omnibump --deps deps.yaml --properties properties.yaml# Analyze which dependencies use properties
omnibump analyze .Example output:
Dependency Analysis
==================
Language: java
Total dependencies: 15
Dependencies using properties: 12
Properties defined: 5
Property Usage:
---------------
slf4j.version = 2.0.13 (used by 3 dependencies)
netty.version = 4.1.90.Final (used by 8 dependencies)
junit.version = 4.13.2 (used by 1 dependency)
# Analyze what needs updating and get recommendations
omnibump analyze --packages "io.netty@netty-codec-http@4.1.94.Final" \
--output-deps deps.yaml \
--output-props properties.yamlThis generates configuration files based on your project's structure.
# Works automatically with multi-module projects
cd my-maven-project
omnibump analyze
# Update from root directory
omnibump --deps deps.yaml# Update using inline format: groupId@artifactId@version
omnibump --packages "io.netty@netty-codec-http@4.1.94.Final junit@junit@4.13.2@test"For projects using string notation like implementation("group:artifact:version"):
Create deps.yaml:
# language field is optional - will auto-detect
packages:
- name: "org.apache.commons:commons-lang3"
version: "3.18.0"
- name: "io.netty:netty-all"
version: "4.1.101.Final"
- name: "junit:junit"
version: "4.13.3"
scope: testRun update:
omnibump --deps deps.yamlThis updates dependencies in build.gradle or build.gradle.kts:
// Before
implementation("org.apache.commons:commons-lang3:3.12.0")
// After
implementation("org.apache.commons:commons-lang3:3.18.0")For Spring Boot projects using the library() function:
packages:
# Use the display name as it appears in library()
- name: "org.apache.commons:Commons Lang3"
version: "3.18.0"
- name: "io.netty:Netty"
version: "4.1.101.Final"Run update:
omnibump --deps deps.yaml --dir spring-boot-project/spring-boot-dependenciesThis updates:
// Before
library("Commons Lang3", "3.17.0") {
group("org.apache.commons") {
modules = ["commons-lang3"]
}
}
// After
library("Commons Lang3", "3.18.0") {
group("org.apache.commons") {
modules = ["commons-lang3"]
}
}Old approach (manual sed):
sed -i 's/library("Commons Lang3", "3.17.0")/library("Commons Lang3", "3.18.0")/g' \
spring-boot-project/spring-boot-dependencies/build.gradleNew approach (omnibump):
omnibump --packages "org.apache.commons:Commons Lang3@3.18.0" \
--dir spring-boot-project/spring-boot-dependenciesBenefits:
- Type-safe (no typos in sed patterns)
- Works across Groovy and Kotlin DSL
- Handles multiple dependency patterns automatically
- Shows clear diffs with
--show-diff
For projects with subprojects:
# Update root build.gradle
omnibump --deps deps.yaml --dir .
# Or update specific subproject
omnibump --deps deps.yaml --dir subproject-name# Quick CVE fix
omnibump --language java \
--packages "org.apache.commons:commons-lang3@3.18.0 io.netty:netty-all@4.1.101.Final"
# With dry run to preview
omnibump --packages "org.apache.commons:commons-lang3@3.18.0" \
--dry-run --show-diffProjects using gradlew work automatically:
# omnibump updates build.gradle[.kts]
omnibump --deps deps.yaml
# Then build with gradlew as usual
./gradlew buildomnibump supports both DSL formats transparently:
# Same configuration works for both
packages:
- name: "org.springframework.boot:spring-boot-dependencies"
version: "3.2.0"Works with:
build.gradle(Groovy DSL)build.gradle.kts(Kotlin DSL)
# omnibump detects the language automatically
cd any-project
omnibump analyze
omnibump --deps deps.yaml# Force specific language if detection fails
omnibump --language go --deps deps.yaml
omnibump --language rust --deps deps.yaml
omnibump --language java --deps deps.yaml