3 # Copyright © 2017, 2018 Red Hat, Inc. and others.
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
9 xmlstarlet sel -N "maven=http://maven.apache.org/POM/4.0.0" -t \
10 -m "maven:project/maven:dependencyManagement/maven:dependencies/maven:dependency" \
11 -v maven:groupId -o " " -v maven:artifactId -o " classifier=" -v maven:classifier -o " type=" -v maven:type -n \
12 ../artifacts/pom.xml |
16 FNR == NR && predeps && /<dependencies>/ {
20 FNR == NR && !predeps && /<\/dependencies>/ {
24 FNR == NR && postdeps {
27 FNR < NR && !/org.opendaylight/ {
28 printf " <dependency>\n"
29 printf " <groupId>%s</groupId>\n", $1
30 printf " <artifactId>%s</artifactId>\n", $2
31 for (i = 3; i <= NF; i++) {
32 equalidx = index($i, "=")
33 if (equalidx != length($i)) {
34 element = substr($i, 1, equalidx - 1)
35 value = substr($i, equalidx + 1)
36 printf " <%s>%s</%s>\n", element, value, element
39 printf " </dependency>\n"
42 ' pom.xml - > pom.xml.new
43 mv pom.xml.new pom.xml