# evaluate the current version string into a variable (obviously you can use other properties than 'project.version')exportVERSION=$(mvn -q-DforceStdout org.apache.maven.plugins:maven-help-plugin:3.3.0:evaluate -Dexpression=project.version)# this little part allows to get rid of a '-SNAPSHOT' suffixexportRELEASEVERSION=${VERSION/-SNAPSHOT/}# alternative which replaces the suffix# export RELEASEVERSION=${VERSION/-SNAPSHOT/-REPLACEMENT}