Skip to content

Instantly share code, notes, and snippets.

@denys-popov
Created June 1, 2011 02:27
Show Gist options
  • Save denys-popov/1001693 to your computer and use it in GitHub Desktop.
Save denys-popov/1001693 to your computer and use it in GitHub Desktop.
[teamcity] get ride of SNAPSHOT in maven2 project
#!/bin/sh
set -xue
snapshot=`find ./target/*.jar | grep -v "sources.jar" |grep -v "original"`
build=`echo "${snapshot}" | sed -r "s/([0-9]+[\.|-]){1,}SNAPSHOT/$BUILD_NUMBER/g"`
cp -v "${snapshot}" "${build}"
find ./target/*SNAPSHOT*.jar | xargs -I % rm "%"
##teamcity[buildStatus status='SUCCESS' text='status']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment