Bump asciidoctor-maven-plugin to 2.2.6
[odlparent.git] / scripts / bump-odl-version
1 #!/bin/bash
2
3 # Copyright © 2019 Red Hat, Inc. and others.
4 #
5 # This program and the accompanying materials are made available under the
6 # terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 # and is available at http://www.eclipse.org/legal/epl-v10.html
8
9 if [ $# -ne 3 ]; then
10     echo "Usage: $0 <project> <current version> <target version>"
11     echo "Bumps all dependencies on the given project from <current version>"
12     echo "to <target version>."
13     echo "E.g. $0 odlparent 3.0.2 3.1.0-SNAPSHOT"
14     exit 1
15 fi
16
17 project=$1
18 curver=$2
19 target=$3
20
21 # We use find/grep instead of git grep to allow running this on
22 # multiple repositories
23 for file in $(find . -type f -name pom.xml | xargs grep -l ${curver})
24 do
25     echo -n Processing ${file}...
26     xmlstarlet ed -P -L -N mvn=http://maven.apache.org/POM/4.0.0 -u //mvn:version[../mvn:groupId=\"org.opendaylight.${project}\"] -v ${target} ${file}
27     echo " done."
28 done