Update dependency-check 28/67728/7
authorStephen Kitt <skitt@redhat.com>
Tue, 30 Jan 2018 15:43:23 +0000 (16:43 +0100)
committerRobert Varga <nite@hq.sk>
Fri, 6 Apr 2018 11:22:23 +0000 (11:22 +0000)
The jackson dependencies have been replaced by jackson-bom.

Change-Id: I1064e546c76acb357d3734c81c0a27b6312fe66a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
odlparent-dependency-check/pom.xml
odlparent-dependency-check/update-dependencies

index 8fb62c1b2bead84120be7654ab7c12cfec495d7d..d86bfa9b184c46150e820741dc87e9a7ec2397cf 100644 (file)
             <artifactId>jersey-all</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.dataformat</groupId>
-            <artifactId>jackson-dataformat-xml</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.datatype</groupId>
-            <artifactId>jackson-datatype-json-org</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.jaxrs</groupId>
-            <artifactId>jackson-jaxrs-base</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.jaxrs</groupId>
-            <artifactId>jackson-jaxrs-json-provider</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.module</groupId>
-            <artifactId>jackson-module-jaxb-annotations</artifactId>
+            <groupId>com.fasterxml.jackson</groupId>
+            <artifactId>jackson-bom</artifactId>
+            <type>pom</type>
+            <version>2.8.9</version>
         </dependency>
         <dependency>
             <groupId>com.google.code.findbugs</groupId>
index 401cd9fa79c8f16e90c03d3689efb8e97ff57a7a..017b99f91163b6e8b45105e971623830d5e3108c 100755 (executable)
@@ -8,7 +8,8 @@
 
 xmlstarlet sel -N "maven=http://maven.apache.org/POM/4.0.0" -t \
 -m "maven:project/maven:dependencyManagement/maven:dependencies/maven:dependency" \
--v maven:groupId -o " " -v maven:artifactId -o " classifier=" -v maven:classifier -o " type=" -v maven:type -n \
+-v maven:groupId -o " " -v maven:artifactId -o " classifier=" -v maven:classifier -o " type=" -v maven:type \
+-o " scope=" -v maven:scope -o " version=" -v maven:version -n \
 ../odlparent/pom.xml |
 sort |
 awk '
@@ -28,12 +29,20 @@ FNR < NR && !/org.opendaylight/ {
   printf "        <dependency>\n"
   printf "            <groupId>%s</groupId>\n", $1
   printf "            <artifactId>%s</artifactId>\n", $2
+  needversion = 0
   for (i = 3; i <= NF; i++) {
     equalidx = index($i, "=")
     if (equalidx != length($i)) {
       element = substr($i, 1, equalidx - 1)
       value = substr($i, equalidx + 1)
-      printf "            <%s>%s</%s>\n", element, value, element
+      if (element == "scope") {
+        if (value == "import") {
+          # Scope import dependencies need to have their version mentioned explicitly
+          needversion = 1
+        }
+      } else if (element != "version" || needversion) {
+        printf "            <%s>%s</%s>\n", element, value, element
+      }
     }
   }
   printf "        </dependency>\n"