3 # Copyright 2017 Huawei Technologies Co., Ltd.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 cat projects.txt | grep -v oparent | grep -v doc | grep -v ci-management | while read p; do
15 #git reset --hard origin
16 for pom in $(find -name pom.xml); do
17 git checkout origin/master -- $pom
18 dos2unix < $pom | cmp -s - $pom
20 if grep -q "oparent" $pom; then
21 xmlstarlet ed -L -P -N ns="http://maven.apache.org/POM/4.0.0" -u '/_:project/_:parent[_:groupId="org.onap.oparent" and _:artifactId="oparent"]/_:version' -v '1.2.0' $pom
22 sed -i 's/^[ \t]*$//' $pom
24 if grep -q "guava" $pom; then
25 xmlstarlet ed -L -P -N ns="http://maven.apache.org/POM/4.0.0" -d '//_:dependency[_:groupId="com.google.guava" and _:artifactId="guava"]/_:version' $pom
26 sed -i 's/^[ \t]*$//' $pom
28 if [ $IS_DOS -ne 0 ]; then
35 if [ $(git rev-parse HEAD) == $(git rev-parse @{u}) ]; then
37 git commit -a -s -m 'Use managed guava version
39 Use centrally managed guava version specified in
40 oparent. Includes upgrade to oparent 1.2.0.
42 This change was submitted by script and may include
43 additional whitespace or formatting changes.
48 git commit -a -s --amend --no-edit
50 git review -r origin -D