Java Bump Version

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Set a JVM (Java or Kotlin) project’s version to an exact value across every file that needs to agree with it. For Maven, a single-module pom.xml has its own <version> rewritten in place, and a reactor (a root pom.xml declaring <modules>) runs mvn versions:set. For Gradle (Kotlin DSL or Groovy), it finds every literal project version declaration and rewrites them all. This skill never computes a version itself — it only applies the exact value it is given, validated for shape, and optionally syncs README/Antora mentions to match.

Purpose

iru-java-bump-version is the JVM-ecosystem leaf that a caller — typically iru-release — delegates the actual version-file edit to, instead of hand-editing build files or duplicating reactor-vs-single-module logic in every skill that needs to change a project’s version. It mirrors the contract iru-typescript-bump-version, iru-android-bump-version, and iru-swift-bump-version define for their own ecosystems, documenting this catalog’s X.Y.Z / X.Y.Z-SNAPSHOT pre-release convention so a caller has one place to read the release/next-dev computation from.

The Gradle path covers Kotlin Spring Boot and Quarkus services and plain JVM libraries. It scans version= in any gradle.properties, version = "…​" in any module’s build.gradle(.kts), and the gradle.properties key or gradle/libs.versions.toml [versions] entry a build script reads its version from. It refuses to write when modules disagree until the user confirms. Android Gradle projects are out of scope and are redirected to iru-android-bump-version.

When the Kotlin Multiplatform plugin is applied anywhere in the build, the skill stops and points to KMP Bump Version instead.

Purpose group

Plugin

Shipped by the iru-java plugin of the ai-catalog marketplace (install with /plugin install iru-java@ai-catalog; see Plugins).

Invocation

/iru-java-bump-version <new-version>

Inputs

Argument Required Description Default

new-version

Yes

Positional. The literal target version string (e.g. 1.4.0 or 1.4.1-SNAPSHOT) to write. This skill applies it verbatim — it does not compute bumps itself.

None — asked for if missing.

sync-files

No

args key. yes|no — whether to also update README/Antora version mentions (Step 7).

Ask once, after Step 2, only if such mentions actually exist.

next-version

No

args key. The upcoming pre-release version (e.g. 1.5.0-SNAPSHOT) that README/Antora "Latest snapshot"/ "Current development version" markers should show after a release, while "Latest release" markers show <new-version>. iru-release passes it alongside the release version.

Unset — development markers are then only rewritten when <new-version> is itself a -SNAPSHOT value.

dry-run

No

args key. yes|no — print the diff / the command that would run, then stop, instead of writing or running anything.

no

Outputs

  • Maven: pom.xml rewritten in place — the root artifact’s own <version> (single module) or every module’s version via mvn versions:set -DgenerateBackupPoms=false (reactor).

  • Gradle: every literal project-version location rewritten (gradle.properties, build.gradle(.kts), gradle/libs.versions.toml [versions]), and nothing else (dependency/plugin versions are untouched).

  • Optionally, when sync-files is accepted: dependency snippets and "Latest release"/"Latest snapshot" markers in README.md, the version: field in docs/antora.yml (only for a released, non--SNAPSHOT value), and Antora pages showing literal dependency snippets.

  • A report of the build tool, the old and new version, reactor vs single module (or Gradle locations found), every file touched, and the Step 6 sanity-check result.

  • With dry-run: yes, nothing is written and no mutating command is run — only the diff/command is shown.

Execution flow

flowchart TD A["Start /iru-java-bump-version &lt;new-version&gt;\n+ args: sync-files, next-version, dry-run"] --> B{"new-version given?"} A -. "KMP plugin applied" .-> KMP["Stop: hand off to iru-kmp-bump-version"] B -- no --> B1["Ask user for it"] B1 --> C B -- yes --> C["Step 1: validate shape\nX.Y.Z or X.Y.Z-SNAPSHOT"] C --> C1{"Matches convention?"} C1 -- no --> C2["Warn, ask whether to\nproceed anyway"] C1 -- yes --> D C2 --> D["Step 2: detect build tool"] D --> D1{"Build tool?"} D1 -- "Android plugin applied" --> D2["Stop - point to\niru-android-bump-version"] D1 -- "neither pom nor Gradle" --> D3["Ask user for path/build tool"] D1 -- Maven --> E["Step 3: locate project version\n(direct child of project, never parent)"] D1 -- Gradle --> E2["Step 3: scan every literal\nversion location"] E2 --> E3{"Locations disagree?"} E3 -- yes --> E4["Ask user: align all with --force\nor leave some alone"] E3 -- no --> G3 E4 --> G3 E --> F{"Reactor?"} F -- reactor --> G1{"dry-run?"} G1 -- yes --> G1a["versions:set -DdryRun\nor list matching POMs"] G1 -- no --> G1b["mvn versions:set\n-DgenerateBackupPoms=false"] F -- "single module" --> G2{"dry-run?"} G2 -- yes --> G2a["Unified diff of pom.xml"] G2 -- no --> G2b["Rewrite own version element"] G3["Step 4: Gradle helper rewrites\nlocations or prints diff"] --> G4{"dry-run?"} G4 -- yes --> Z G4 -- no --> H2 G1a --> Z["Report diff/command,\nstop - nothing written"] G2a --> Z G1b --> H["Step 6: mvn help:evaluate\nproject.version"] G2b --> H H2["Step 6: gradlew properties\nversion check"] --> H1 H --> H1{"Output matches new-version?"} H1 -- no --> H3["Stop, show actual\nerror - no success claim"] H1 -- yes --> I{"sync-files?"} I -- "ask (unset)" --> I1["Step 7: check README / antora.yml /\npages for version mentions"] I1 --> I2{"Any found?"} I2 -- no --> J I2 -- yes --> I3["AskUserQuestion: sync them too?"] I3 -- yes --> I4["Update matched snippets\nand markers"] I3 -- no --> J I -- yes --> I4 I -- no --> J I4 --> J["Step 8: report build tool, old/new version,\nfiles touched, sanity-check result"]

Dependencies

Invokes

None — iru-java-bump-version is a leaf skill; it only runs Maven (mvn versions:set, mvn help:evaluate), Gradle (./gradlew properties) and Python/regex file rewrites, and reports on the outcome. It does not call any other skill in this catalog (it only points the user at iru-android-bump-version for Android projects).

It also points Kotlin Multiplatform projects at KMP Bump Version but does not invoke it.

Invoked by

  • Release — Step 6, version bump for Java/Kotlin JVM projects (Maven or Gradle).

version, once to bump and reappend -SNAPSHOT for the next development cycle) when iru-release detects the repository’s ecosystem is Java/Maven, discovered by its find .claude/skills -maxdepth 1 -type d -name "iru-*-bump-version" lookup.

None — this skill runs inline; it does not spawn any agent.

Source

SKILL.md on GitHub — the file this page was generated from.