Skip to content

Commit 410bfc6

Browse files
authored
Add version script
1 parent 510c53b commit 410bfc6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

update_major_version.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# Get the current project version using Maven
4+
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
5+
echo "Current version: $current_version"
6+
7+
# Extract the major version and increment it
8+
major=${current_version%%.*}
9+
new_major=$((major + 1))
10+
11+
# Construct the new version string
12+
new_version="${new_major}.0.0"
13+
echo "New version: $new_version"
14+
15+
# Set the new version using Maven
16+
mvn versions:set -DnewVersion=$new_version

0 commit comments

Comments
 (0)