David Matějček | 2f4c277 | 2021-06-07 09:07:32 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -x |
| 4 | set -e |
| 5 | |
| 6 | version=${1} |
| 7 | if [ "${version}" == "" ]; then |
| 8 | echo "New version number expected!" |
| 9 | exit 1; |
| 10 | fi |
| 11 | |
David Matějček | 525c45f | 2021-06-07 11:03:38 +0200 | [diff] [blame] | 12 | oldVersion="$(mvn help:evaluate -Dexpression=project.version -N -q -DforceStdout)" |
David Matějček | 2f4c277 | 2021-06-07 09:07:32 +0200 | [diff] [blame] | 13 | implicitVersionParams="-DgenerateBackupPoms=false -DprocessAllModules=true -DoldVersion=${oldVersion}" |
| 14 | |
| 15 | # change version of the aggregator and keep consistency |
| 16 | mvn versions:set ${implicitVersionParams} -DnewVersion=${version} -Pembedded,set-version-id; |
| 17 | |
| 18 | # these folders are broken now, but we keep updating version ids at least |
| 19 | find "./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}"; |
| 26 | done |