blob: b9f862f1415ec83c2cf796389086517d2f8a2c18 [file] [log] [blame]
David Matějček2f4c2772021-06-07 09:07:32 +02001#!/bin/bash
2
3set -x
4set -e
5
6version=${1}
7if [ "${version}" == "" ]; then
8 echo "New version number expected!"
9 exit 1;
10fi
11
David Matějček525c45f2021-06-07 11:03:38 +020012oldVersion="$(mvn help:evaluate -Dexpression=project.version -N -q -DforceStdout)"
David Matějček2f4c2772021-06-07 09:07:32 +020013implicitVersionParams="-DgenerateBackupPoms=false -DprocessAllModules=true -DoldVersion=${oldVersion}"
14
15# change version of the aggregator and keep consistency
16mvn versions:set ${implicitVersionParams} -DnewVersion=${version} -Pembedded,set-version-id;
17
18# these folders are broken now, but we keep updating version ids at least
19find "./appserver/tests" -type f -name "pom.xml" -print0 | while IFS= read -r -d '' file; do
20 echo "Processing file: ${file}";
21 sedexpression="s/${oldVersion}/${version}/g";
22 cat "${file}" | sed -e "${sedexpression}" > "${file}.temporary";
23 fileMode=$(stat -c %a "${file}");
24 mv "${file}.temporary" "${file}";
25 chmod $fileMode "${file}";
26done