From 20760f1ea03ed279f893361508a43e9cf4be46f9 Mon Sep 17 00:00:00 2001 From: alexgrent <51237839+alexgrent@users.noreply.github.com> Date: Thu, 20 Mar 2025 09:29:31 +0000 Subject: [PATCH] Version change script --- update_minor_version.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 update_minor_version.sh diff --git a/update_minor_version.sh b/update_minor_version.sh new file mode 100644 index 0000000..b2c514a --- /dev/null +++ b/update_minor_version.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Get the current version from Maven +current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) +echo "Current version: $current_version" + +# Extract major, minor, and patch versions +major=${current_version%%.*} +rest=${current_version#*.} +minor=${rest%%.*} +patch=${rest#*.} + +# Increment the minor version +new_minor=$((minor + 1)) +new_version="${major}.${new_minor}.0" + +# Output the new version +echo "New version: $new_version" + +# Set the new version in Maven +mvn versions:set -DnewVersion=$new_version