Bump up BND to version 4.0.0 in preparation for Java 10

Change-Id: Ieb4b718d6e0077c3b620afe0d8ec50a5901f868f
diff --git a/lib/BUCK b/lib/BUCK
index 73d96ee..e89fa92 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Thu, 6 Sep 2018 23:27:43 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Mon, 10 Sep 2018 20:11:15 GMT. Do not edit this file manually. *****
 # ***** Use onos-lib-gen *****
 
 pass_thru_pom(
@@ -1383,19 +1383,19 @@
 
 remote_jar (
   name = 'bndlib',
-  out = 'biz.aQute.bndlib-3.1.0.jar',
-  url = 'mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:3.1.0',
-  sha1 = '8e45564ca80bf089276a35f916e8702e7b798cbb',
-  maven_coords = 'biz.aQute.bnd:biz.aQute.bndlib:3.1.0',
+  out = 'biz.aQute.bndlib-4.0.0.jar',
+  url = 'mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:4.0.0',
+  sha1 = '21e1d6fd1874d9bc201f2de1d0a48e84bff4149d',
+  maven_coords = 'biz.aQute.bnd:biz.aQute.bndlib:4.0.0',
   visibility = [ 'PUBLIC' ],
 )
 
 remote_jar (
   name = 'bndexe',
-  out = 'biz.aQute.bnd-3.1.0.jar',
-  url = 'mvn:biz.aQute.bnd:biz.aQute.bnd:jar:3.1.0',
-  sha1 = 'ebd6c2af025b66ea94a9fcb217c2699ba23d3ca2',
-  maven_coords = 'biz.aQute.bnd:biz.aQute.bnd:3.1.0',
+  out = 'biz.aQute.bnd-4.0.0.jar',
+  url = 'mvn:biz.aQute.bnd:biz.aQute.bnd:jar:4.0.0',
+  sha1 = 'fa7746eb710852498ce1afe5227be3fbfddaf09e',
+  maven_coords = 'biz.aQute.bnd:biz.aQute.bnd:4.0.0',
   visibility = [ 'PUBLIC' ],
 )
 
diff --git a/lib/deps.json b/lib/deps.json
index 375f3b0..6a52650 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -269,8 +269,8 @@
     "checkstyle": "mvn:com.puppycrawl.tools:checkstyle:8.10",
     "apache-karaf": "http://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/3.0.8/apache-karaf-offline-3.0.8.tar.gz",
     "apache-karaf-patches": "http://repo1.maven.org/maven2/org/onosproject/onos-apache-karaf-patches/3.0.8/onos-apache-karaf-patches-3.0.8.tar.gz",
-    "bndlib": "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:3.1.0",
-    "bndexe": "mvn:biz.aQute.bnd:biz.aQute.bnd:3.1.0",
+    "bndlib": "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:4.0.0",
+    "bndexe": "mvn:biz.aQute.bnd:biz.aQute.bnd:4.0.0",
     "libthrift": "mvn:org.apache.thrift:libthrift:0.9.3",
     "qdox": "mvn:com.thoughtworks.qdox:qdox:2.0-M3",
     "org.apache.felix.scr.bnd": {
diff --git a/tools/build/bazel/generate_workspace.bzl b/tools/build/bazel/generate_workspace.bzl
index 9c347a9..44da091 100644
--- a/tools/build/bazel/generate_workspace.bzl
+++ b/tools/build/bazel/generate_workspace.bzl
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Thu, 6 Sep 2018 23:27:20 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Mon, 10 Sep 2018 20:10:18 GMT. Do not edit this file manually. *****
 # ***** Use onos-lib-gen *****
 
 load("//tools/build/bazel:variables.bzl", "ONOS_GROUP_ID", "ONOS_VERSION")
@@ -918,15 +918,15 @@
     if "bndlib" not in native.existing_rules():
         java_import_external(
             name = "bndlib",
-            jar_sha256 = "a17d4b9dc4b9c6e5699e20ea0546ff1eeb1cdb7d0155947d48527d14f54e6a44",
+            jar_sha256 = "d1a328c8f63aea4f7ce6028a49255137664a7138fadc4af9d25461192b71e098",
             licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/3.1.0/biz.aQute.bndlib-3.1.0.jar"],        )
+            jar_urls = ["http://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/4.0.0/biz.aQute.bndlib-4.0.0.jar"],        )
     if "bndexe" not in native.existing_rules():
         java_import_external(
             name = "bndexe",
-            jar_sha256 = "ab11d1b7646b4cc0bbc87dfb873c911bbbbc7144c37c7b25164d881d46f0b0dd",
+            jar_sha256 = "b18d88ae15db4bf7af53c396feb45a64f27403d7e7d7cd50a68bf8915ca7b6c0",
             licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/3.1.0/biz.aQute.bnd-3.1.0.jar"],        )
+            jar_urls = ["http://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/4.0.0/biz.aQute.bnd-4.0.0.jar"],        )
     if "libthrift" not in native.existing_rules():
         java_import_external(
             name = "libthrift",
@@ -1454,8 +1454,8 @@
 artifact_map["@checkstyle//:checkstyle"] = "mvn:com.puppycrawl.tools:checkstyle:jar:NON-OSGI:8.10"
 artifact_map["@apache_karaf//:apache_karaf"] = "http://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/3.0.8/apache-karaf-offline-3.0.8.tar.gz"
 artifact_map["@apache_karaf_patches//:apache_karaf_patches"] = "http://repo1.maven.org/maven2/org/onosproject/onos-apache-karaf-patches/3.0.8/onos-apache-karaf-patches-3.0.8.tar.gz"
-artifact_map["@bndlib//:bndlib"] = "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:3.1.0"
-artifact_map["@bndexe//:bndexe"] = "mvn:biz.aQute.bnd:biz.aQute.bnd:jar:3.1.0"
+artifact_map["@bndlib//:bndlib"] = "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:4.0.0"
+artifact_map["@bndexe//:bndexe"] = "mvn:biz.aQute.bnd:biz.aQute.bnd:jar:4.0.0"
 artifact_map["@libthrift//:libthrift"] = "mvn:org.apache.thrift:libthrift:jar:0.9.3"
 artifact_map["@qdox//:qdox"] = "mvn:com.thoughtworks.qdox:qdox:jar:NON-OSGI:2.0-M3"
 artifact_map["@org_apache_felix_scr_bnd//:org_apache_felix_scr_bnd"] = "https://oss.sonatype.org/content/repositories/snapshots/org/onosproject/org.apache.felix.scr.bnd/1.4.1-SNAPSHOT/org.apache.felix.scr.bnd-1.4.1-20160328.235003-2.jar"
diff --git a/utils/osgiwrap/BUILD b/utils/osgiwrap/BUILD
index 9193c04..6175961 100644
--- a/utils/osgiwrap/BUILD
+++ b/utils/osgiwrap/BUILD
@@ -4,6 +4,8 @@
     "@com_google_guava_guava//jar",
     "@bndlib//jar",
     "@org_apache_felix_scr_bnd//jar",
+    "@slf4j_api//jar",
+    "@slf4j_nop//jar",
 ]
 
 java_binary(
diff --git a/utils/osgiwrap/src/main/java/org/onlab/osgiwrap/OSGiWrapper.java b/utils/osgiwrap/src/main/java/org/onlab/osgiwrap/OSGiWrapper.java
index 8a8d16f..821bf40 100644
--- a/utils/osgiwrap/src/main/java/org/onlab/osgiwrap/OSGiWrapper.java
+++ b/utils/osgiwrap/src/main/java/org/onlab/osgiwrap/OSGiWrapper.java
@@ -383,7 +383,7 @@
         }
     }
 
-    private boolean addFileToJar(Jar jar, String destination, String sourceAbsPath) {
+    private boolean addFileToJar(Jar jar, String destination, String sourceAbsPath) throws IOException {
         if (includedResources.contains(sourceAbsPath)) {
             log("Skipping already included resource: %s\n", sourceAbsPath);
             return false;