Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Assess and upgrade Azure workloads between plans, tiers, or SKUs with automated migration steps
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/languages/java/bom-migration/bom-migration.md
1# BOM Migration Guide23How to add or upgrade `azure-sdk-bom` and clean up redundant versions across all supported build configurations.45## Prerequisite — Python availability check67The Maven and plain-Gradle flows are automated by `scripts/upgrade_bom.py` (Python 3.8+). Before picking a guide, verify Python is available:89The following check works in both **bash** and **PowerShell 7+** (the `||` operator is supported in both):1011```bash12python3 --version || python --version13```1415For Windows PowerShell 5.1, use:1617```powershell18python3 --version; if ($LASTEXITCODE -ne 0) { python --version }19```2021- **Python available** → use the script as documented in [bom-maven.md](./bom-maven.md) / [bom-gradle.md](./bom-gradle.md).22- **Python NOT available** → follow the **Manual Fallback** section in the same guide. Do not attempt to install Python; perform the edits by hand.2324The TOML and programmatic-catalog guides ([bom-gradle-toml.md](./bom-gradle-toml.md), [bom-gradle-settings.md](./bom-gradle-settings.md)) are manual-only and unaffected by Python availability.2526## Determine the latest BOM version2728Resolve the target `azure-sdk-bom` version from the Azure SDK for Java source of truth before editing build files. This is mandatory: do not hardcode, guess, or reuse an illustrative version from another example. Versions below `1.3.0` are invalid for this migration flow.2930The following invocation works identically in **bash** and **PowerShell** (no shell-specific syntax):3132```bash33# Path is relative to the skill directory (plugin/skills/azure-upgrade/)34python3 ./references/languages/java/scripts/upgrade_bom.py --get-latest-version35# or: python ./references/languages/java/scripts/upgrade_bom.py --get-latest-version36```3738If Python is not available, fetch `https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/boms/azure-sdk-bom/pom.xml` directly and use the `<version>` value declared in that BOM `pom.xml`.3940Do not continue until you have resolved that latest stable version explicitly.4142## Decision Tree4344```45Is the project Maven?46├─ YES → Maven projects (bom-maven.md)47└─ NO (Gradle)48├─ Does gradle/libs.versions.toml exist with Azure entries?49│ └─ YES → TOML catalog steps (bom-gradle-toml.md)50├─ Does settings.gradle define a programmatic versionCatalogs block with Azure entries?51│ └─ YES → Programmatic catalog steps (bom-gradle-settings.md)52└─ Neither (plain build.gradle dependencies)53└─ Plain Gradle projects (bom-gradle.md)54```5556> 💡 **Tip:** To check which artifacts are managed by the BOM, fetch57> `https://repo1.maven.org/maven2/com/azure/azure-sdk-bom/{bom_version}/azure-sdk-bom-{bom_version}.pom`58> and look for `<dependency>` entries.5960## Build-System Guides6162| Build system | Guide |63|---|---|64| Maven | [bom-maven.md](./bom-maven.md) |65| Gradle (no version catalog) | [bom-gradle.md](./bom-gradle.md) |66| Gradle + TOML version catalog | [bom-gradle-toml.md](./bom-gradle-toml.md) |67| Gradle + programmatic catalog | [bom-gradle-settings.md](./bom-gradle-settings.md) |6869## Validation7071See the [Validation Checklist](./bom-validation.md) — covers all build systems including TOML and programmatic `settings.gradle` catalogs.72