summaryrefslogtreecommitdiffstats
path: root/jjb/include-update-pom-versions.sh
blob: db1dd26cc4e9f022d7e5ab63764c4aaeb8568ad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

## Will update POM in workspace with release version

if [ ! -e version.properties ]; then
    echo "Missing version.properties"
    exit 1
fi

## will setup variable release_version
source ./version.properties

VERSION=$release_version

echo Changing POM version to $VERSION

## handle POM files with no parent
for file in $(find . -name pom.xml); do
    if [ "$(grep -c '<parent>' $file)" == "0" ]; then
        echo Updating version in $file to $VERSION
        (
            cd $(dirname $file)
            ${MVN} versions:set versions:commit \
                -DnewVersion=$VERSION \
                -DprocessDependencies=false
        )
        grep version $file
        echo DONE $file
    fi
done

find . -name pom.xml.versionsBackup -delete