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
Looks like you want to edit the pom.xml in the backend. Try the Perl one-liner. Check this out.
> cat pom.xml
4.0.0
com.mss.inven
INVEN
0.0.1-SNAPSHOT
> perl -ne ' { s/(.*)\.(\d+)(-SNAPSHOT.*)/printf("%s.%d%s",$1,$2+1,$3)/ge and $_=~s/.$//g if //; print } ' pom.xml
4.0.0
com.mss.inven
INVEN
0.0.2-SNAPSHOT
>