blob: db1dd26cc4e9f022d7e5ab63764c4aaeb8568ad2 [file] [log] [blame]
Carsten Lund2d06a692017-02-23 18:23:07 +00001#!/bin/bash
2
3## Will update POM in workspace with release version
4
5if [ ! -e version.properties ]; then
6 echo "Missing version.properties"
7 exit 1
8fi
9
10## will setup variable release_version
11source ./version.properties
12
13VERSION=$release_version
14
Carsten Lundc27b0912017-02-24 00:10:24 +000015echo Changing POM version to $VERSION
16
Carsten Lund2d06a692017-02-23 18:23:07 +000017## handle POM files with no parent
18for file in $(find . -name pom.xml); do
19 if [ "$(grep -c '<parent>' $file)" == "0" ]; then
Carsten Lundc27b0912017-02-24 00:10:24 +000020 echo Updating version in $file to $VERSION
Carsten Lund2d06a692017-02-23 18:23:07 +000021 (
22 cd $(dirname $file)
23 ${MVN} versions:set versions:commit \
24 -DnewVersion=$VERSION \
25 -DprocessDependencies=false
26 )
Carsten Lundc27b0912017-02-24 00:10:24 +000027 grep version $file
28 echo DONE $file
Carsten Lund2d06a692017-02-23 18:23:07 +000029 fi
30done
31
32find . -name pom.xml.versionsBackup -delete
33