@echo off
cls

rem Name of git tag.
set TAG_NAME="v%DATE:-=.%"

rem Remove old local tag.
git tag -d "%TAG_NAME%"

rem Remove old remote tag.
git push origin --delete "%TAG_NAME%"

rem Prepare a release without push remote tag and changes.
mvn release:prepare -DremoteTagging=false -DpushChanges=false

rem Push remote tag and changes.
git commit -a -m "Prepare a release"
git tag "%TAG_NAME%"
git push
git push --tags
git push origin

rem Perform a release.
mvn release:perform

rem end of file