Skip to content

Commit 20760f1

Browse files
authored
Version change script
1 parent e9bcbc9 commit 20760f1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

update_minor_version.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Get the current version from Maven
4+
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
5+
echo "Current version: $current_version"
6+
7+
# Extract major, minor, and patch versions
8+
major=${current_version%%.*}
9+
rest=${current_version#*.}
10+
minor=${rest%%.*}
11+
patch=${rest#*.}
12+
13+
# Increment the minor version
14+
new_minor=$((minor + 1))
15+
new_version="${major}.${new_minor}.0"
16+
17+
# Output the new version
18+
echo "New version: $new_version"
19+
20+
# Set the new version in Maven
21+
mvn versions:set -DnewVersion=$new_version

0 commit comments

Comments
 (0)