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