Previously I used below command to take the version in pom.xml and increment it from one. Before increment snapshot version is, 0.0.1
#!/bin/bas
Yes you can use sed to modify the version in pom.xml file. Simply add, at the end of your given bash script, those two lines:
LN=$(grep -n "" pom.xml | head -1 | awk -F ":" '{print $1}')
sed -i "$LN s/$version/$incrementVer/" pom.xml
Explanation: