Brad Lucas

Programming, Clojure and other interests
June 29, 2017

Bump Version

A script to bump the version number in a pom.xml file.

bump-version.sh

#!/bin/bash

# A script to bump the version number inside a pom.xml file
#

if [ -z "$1" ]
then
    echo ""
    echo "Bump version script for incrementing the version number in a project's pom.xml file."
    echo ""
    echo "Usage: bump-version 'version-string'"
    echo ""
    echo ""
    exit
fi

VER=$1
echo $VER

# enure we have a value 
CMD="mvn versions:set -DnewVersion=$VER"
echo "Executing:"
echo $CMD

mvn versions:set -DnewVersion=$VER


echo "done"

Tags: java