Fixing few issues in feature generation and local run capability for Bazel build.

Change-Id: Ifd72aff1c56cceadd0bde93c94bdaf4a9a7dfbd2
diff --git a/BUILD b/BUILD
index 303f1f8..934ecd3 100644
--- a/BUILD
+++ b/BUILD
@@ -81,12 +81,12 @@
 
 # Runs ONOS as a single instance from the /tmp directory
 # FIXME: Still work in progress
-#genrule(
-#    name = "onos-run",
-#    outs = ["onos-runner"],
-#    srcs = ["onos-run-karaf", "onos-package"],
-#    cmd = "sed \"s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#\" $(location onos-run-karaf) > $(location onos-runner); chmod +x $(location onos-runner)",
-#    executable = True,
-#    output_to_bindir = True,
-#    visibility = ["//visibility:public"],
-#)
+genrule(
+    name = "onos-run",
+    outs = ["onos-runner"],
+    srcs = [":onos-package", "tools/package/onos-run-karaf"],
+    cmd = "sed \"s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#\" $(location tools/package/onos-run-karaf) > $(location onos-runner); chmod +x $(location onos-runner)",
+    executable = True,
+    output_to_bindir = True,
+    visibility = ["//visibility:public"],
+)
diff --git a/tools/build/bazel/generate_workspace.bzl b/tools/build/bazel/generate_workspace.bzl
index 39ccf93..a789d10 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 Tue, 19 Jun 2018 22:30:34 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Fri, 29 Jun 2018 16:58:53 GMT. Do not edit this file manually. *****
 # ***** Use onos-lib-gen *****
 
 load("//tools/build/bazel:variables.bzl", "ONOS_GROUP_ID", "ONOS_VERSION")
@@ -2118,7 +2118,7 @@
 artifact_map[str(Label("@commons_io//jar"))] = "mvn:commons-io:commons-io:jar:2.6"
 artifact_map[str(Label("@commons_jxpath//jar"))] = "mvn:commons-jxpath:commons-jxpath:jar:1.3"
 artifact_map[str(Label("@commons_beanutils//jar"))] = "mvn:commons-beanutils:commons-beanutils:jar:1.9.3"
-artifact_map[str(Label("@jdom//jar"))] = "mvn:jdom:jdom:jar:1.0"
+artifact_map[str(Label("@jdom//jar"))] = "mvn:jdom:jdom:jar:NON-OSGI:1.0"
 artifact_map[str(Label("@commons_lang//jar"))] = "mvn:commons-lang:commons-lang:jar:2.6"
 artifact_map[str(Label("@commons_lang3//jar"))] = "mvn:org.apache.commons:commons-lang3:jar:3.7"
 artifact_map[str(Label("@commons_logging//jar"))] = "mvn:commons-logging:commons-logging:jar:1.2"
@@ -2127,27 +2127,27 @@
 artifact_map[str(Label("@commons_text//jar"))] = "mvn:org.apache.commons:commons-text:jar:1.3"
 artifact_map[str(Label("@concurrent_trees//jar"))] = "mvn:com.googlecode.concurrent-trees:concurrent-trees:jar:2.6.1"
 artifact_map[str(Label("@easymock//jar"))] = "mvn:org.easymock:easymock:jar:3.6"
-artifact_map[str(Label("@antlr//jar"))] = "mvn:antlr:antlr:jar:2.7.7"
-artifact_map[str(Label("@error_prone_annotations//jar"))] = "mvn:com.google.errorprone:error_prone_annotations:jar:2.0.18"
-artifact_map[str(Label("@ganymed_ssh2//jar"))] = "mvn:ch.ethz.ganymed:ganymed-ssh2:jar:262"
+artifact_map[str(Label("@antlr//jar"))] = "mvn:antlr:antlr:jar:NON-OSGI:2.7.7"
+artifact_map[str(Label("@error_prone_annotations//jar"))] = "mvn:com.google.errorprone:error_prone_annotations:jar:NON-OSGI:2.0.18"
+artifact_map[str(Label("@ganymed_ssh2//jar"))] = "mvn:ch.ethz.ganymed:ganymed-ssh2:jar:NON-OSGI:262"
 artifact_map[str(Label("@gmetric4j//jar"))] = "mvn:info.ganglia.gmetric4j:gmetric4j:jar:1.0.10"
 artifact_map[str(Label("@gson//jar"))] = "mvn:com.google.code.gson:gson:jar:2.7"
 artifact_map[str(Label("@guava//jar"))] = "mvn:com.google.guava:guava:jar:22.0"
-artifact_map[str(Label("@guava_testlib//jar"))] = "mvn:com.google.guava:guava-testlib:jar:22.0"
-artifact_map[str(Label("@hamcrest_all//jar"))] = "mvn:org.hamcrest:hamcrest-all:jar:1.3"
+artifact_map[str(Label("@guava_testlib//jar"))] = "mvn:com.google.guava:guava-testlib:jar:NON-OSGI:22.0"
+artifact_map[str(Label("@hamcrest_all//jar"))] = "mvn:org.hamcrest:hamcrest-all:jar:NON-OSGI:1.3"
 artifact_map[str(Label("@hk2_api//jar"))] = "mvn:org.glassfish.hk2:hk2-api:jar:2.5.0-b42"
 artifact_map[str(Label("@hk2_locator//jar"))] = "mvn:org.glassfish.hk2:hk2-locator:jar:2.5.0-b42"
 artifact_map[str(Label("@hk2_osgi_resource_locator//jar"))] = "mvn:org.glassfish.hk2:osgi-resource-locator:jar:1.0.1"
 artifact_map[str(Label("@hk2_utils//jar"))] = "mvn:org.glassfish.hk2:hk2-utils:jar:2.5.0-b42"
 artifact_map[str(Label("@httpclient_osgi//jar"))] = "mvn:org.apache.httpcomponents:httpclient-osgi:jar:4.5.1"
 artifact_map[str(Label("@httpcore_osgi//jar"))] = "mvn:org.apache.httpcomponents:httpcore-osgi:jar:4.4.4"
-artifact_map[str(Label("@influxdb_java//jar"))] = "mvn:org.influxdb:influxdb-java:jar:2.9"
-artifact_map[str(Label("@retrofit//jar"))] = "mvn:com.squareup.retrofit2:retrofit:jar:2.3.0"
-artifact_map[str(Label("@converter_moshi//jar"))] = "mvn:com.squareup.retrofit2:converter-moshi:jar:2.3.0"
-artifact_map[str(Label("@okhttp//jar"))] = "mvn:com.squareup.okhttp3:okhttp:jar:3.9.1"
-artifact_map[str(Label("@logging_interceptor//jar"))] = "mvn:com.squareup.okhttp3:logging-interceptor:jar:3.9.1"
-artifact_map[str(Label("@moshi//jar"))] = "mvn:com.squareup.moshi:moshi:jar:1.4.0"
-artifact_map[str(Label("@okio//jar"))] = "mvn:com.squareup.okio:okio:jar:1.11.0"
+artifact_map[str(Label("@influxdb_java//jar"))] = "mvn:org.influxdb:influxdb-java:jar:NON-OSGI:2.9"
+artifact_map[str(Label("@retrofit//jar"))] = "mvn:com.squareup.retrofit2:retrofit:jar:NON-OSGI:2.3.0"
+artifact_map[str(Label("@converter_moshi//jar"))] = "mvn:com.squareup.retrofit2:converter-moshi:jar:NON-OSGI:2.3.0"
+artifact_map[str(Label("@okhttp//jar"))] = "mvn:com.squareup.okhttp3:okhttp:jar:NON-OSGI:3.9.1"
+artifact_map[str(Label("@logging_interceptor//jar"))] = "mvn:com.squareup.okhttp3:logging-interceptor:jar:NON-OSGI:3.9.1"
+artifact_map[str(Label("@moshi//jar"))] = "mvn:com.squareup.moshi:moshi:jar:NON-OSGI:1.4.0"
+artifact_map[str(Label("@okio//jar"))] = "mvn:com.squareup.okio:okio:jar:NON-OSGI:1.11.0"
 artifact_map[str(Label("@jackson_annotations//jar"))] = "mvn:com.fasterxml.jackson.core:jackson-annotations:jar:2.9.5"
 artifact_map[str(Label("@jackson_core//jar"))] = "mvn:com.fasterxml.jackson.core:jackson-core:jar:2.9.5"
 artifact_map[str(Label("@jackson_databind//jar"))] = "mvn:com.fasterxml.jackson.core:jackson-databind:jar:2.9.5"
@@ -2155,7 +2155,7 @@
 artifact_map[str(Label("@javax_inject//jar"))] = "mvn:org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42"
 artifact_map[str(Label("@javax_ws_rs_api//jar"))] = "mvn:javax.ws.rs:javax.ws.rs-api:jar:2.1"
 artifact_map[str(Label("@jersey_client//jar"))] = "mvn:org.glassfish.jersey.core:jersey-client:jar:2.26"
-artifact_map[str(Label("@jersey_security//jar"))] = "mvn:org.glassfish.jersey.security:oauth2-client:jar:2.26"
+artifact_map[str(Label("@jersey_security//jar"))] = "mvn:org.glassfish.jersey.security:oauth2-client:jar:NON-OSGI:2.26"
 artifact_map[str(Label("@jersey_common//jar"))] = "mvn:org.glassfish.jersey.core:jersey-common:jar:2.26"
 artifact_map[str(Label("@jersey_container_jetty_http//jar"))] = "mvn:org.glassfish.jersey.containers:jersey-container-jetty-http:jar:2.26"
 artifact_map[str(Label("@jersey_container_servlet//jar"))] = "mvn:org.glassfish.jersey.containers:jersey-container-servlet:jar:2.26"
@@ -2163,8 +2163,8 @@
 artifact_map[str(Label("@jersey_media_multipart//jar"))] = "mvn:org.glassfish.jersey.media:jersey-media-multipart:jar:2.26"
 artifact_map[str(Label("@jersey_server//jar"))] = "mvn:org.glassfish.jersey.core:jersey-server:jar:2.26"
 artifact_map[str(Label("@jersey_hk2//jar"))] = "mvn:org.glassfish.jersey.inject:jersey-hk2:jar:2.26"
-artifact_map[str(Label("@jersey_test_framework_core//jar"))] = "mvn:org.glassfish.jersey.test-framework:jersey-test-framework-core:jar:2.26"
-artifact_map[str(Label("@jersey_test_framework_jetty//jar"))] = "mvn:org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty:jar:2.26"
+artifact_map[str(Label("@jersey_test_framework_core//jar"))] = "mvn:org.glassfish.jersey.test-framework:jersey-test-framework-core:jar:NON-OSGI:2.26"
+artifact_map[str(Label("@jersey_test_framework_jetty//jar"))] = "mvn:org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty:jar:NON-OSGI:2.26"
 artifact_map[str(Label("@jetty_util//jar"))] = "mvn:org.eclipse.jetty:jetty-util:jar:9.2.21.v20170120"
 artifact_map[str(Label("@jetty_websocket//jar"))] = "mvn:org.eclipse.jetty:jetty-websocket:jar:8.1.19.v20160209"
 artifact_map[str(Label("@jetty_server//jar"))] = "mvn:org.eclipse.jetty:jetty-server:jar:9.2.21.v20170120"
@@ -2173,16 +2173,16 @@
 artifact_map[str(Label("@jetty_io//jar"))] = "mvn:org.eclipse.jetty:jetty-io:jar:9.2.21.v20170120"
 artifact_map[str(Label("@javax_servlet_api//jar"))] = "mvn:javax.servlet:javax.servlet-api:jar:3.1.0"
 artifact_map[str(Label("@joda_time//jar"))] = "mvn:joda-time:joda-time:jar:2.9.3"
-artifact_map[str(Label("@jsch//jar"))] = "mvn:com.jcraft:jsch:jar:0.1.53"
+artifact_map[str(Label("@jsch//jar"))] = "mvn:com.jcraft:jsch:jar:NON-OSGI:0.1.53"
 artifact_map[str(Label("@jsr305//jar"))] = "mvn:com.google.code.findbugs:jsr305:jar:3.0.1"
-artifact_map[str(Label("@junit//jar"))] = "mvn:junit:junit:jar:4.12"
-artifact_map[str(Label("@junit_dep//jar"))] = "mvn:junit:junit:jar:4.10"
+artifact_map[str(Label("@junit//jar"))] = "mvn:junit:junit:jar:NON-OSGI:4.12"
+artifact_map[str(Label("@junit_dep//jar"))] = "mvn:junit:junit:jar:NON-OSGI:4.10"
 artifact_map[str(Label("@kryo//jar"))] = "mvn:com.esotericsoftware:kryo:jar:4.0.1"
 artifact_map[str(Label("@mapdb//jar"))] = "mvn:org.mapdb:mapdb:jar:1.0.9"
 artifact_map[str(Label("@metrics_core//jar"))] = "mvn:io.dropwizard.metrics:metrics-core:jar:3.2.2"
 artifact_map[str(Label("@metrics_ganglia//jar"))] = "mvn:io.dropwizard.metrics:metrics-ganglia:jar:3.2.2"
 artifact_map[str(Label("@metrics_graphite//jar"))] = "mvn:io.dropwizard.metrics:metrics-graphite:jar:3.2.2"
-artifact_map[str(Label("@metrics_influxdb//jar"))] = "mvn:com.izettle:metrics-influxdb:jar:1.1.1"
+artifact_map[str(Label("@metrics_influxdb//jar"))] = "mvn:com.izettle:metrics-influxdb:jar:NON-OSGI:1.1.1"
 artifact_map[str(Label("@metrics_json//jar"))] = "mvn:io.dropwizard.metrics:metrics-json:jar:3.2.2"
 artifact_map[str(Label("@minimal_json//jar"))] = "mvn:com.eclipsesource.minimal-json:minimal-json:jar:0.9.4"
 artifact_map[str(Label("@minlog//jar"))] = "mvn:com.esotericsoftware:minlog:jar:1.3.0"
@@ -2200,11 +2200,11 @@
 artifact_map[str(Label("@openflowj//jar"))] = "mvn:org.onosproject:openflowj:jar:3.2.1.onos"
 artifact_map[str(Label("@org_apache_felix_framework_security//jar"))] = "mvn:org.onosproject:org.apache.felix.framework.security:jar:2.2.0.onos"
 artifact_map[str(Label("@org_apache_felix_scr//jar"))] = "mvn:org.apache.felix:org.apache.felix.scr:jar:1.8.2"
-artifact_map[str(Label("@org_apache_felix_scr_annotations//jar"))] = "mvn:org.apache.felix:org.apache.felix.scr.annotations:jar:1.9.12"
+artifact_map[str(Label("@org_apache_felix_scr_annotations//jar"))] = "mvn:org.apache.felix:org.apache.felix.scr.annotations:jar:NON-OSGI:1.9.12"
 artifact_map[str(Label("@org_apache_karaf_features_core//jar"))] = "mvn:org.apache.karaf.features:org.apache.karaf.features.core:jar:3.0.8"
 artifact_map[str(Label("@org_apache_karaf_shell_console//jar"))] = "mvn:org.apache.karaf.shell:org.apache.karaf.shell.console:jar:3.0.8"
 artifact_map[str(Label("@org_apache_httpcomponents_httpasyncclient_osgi//jar"))] = "mvn:org.apache.httpcomponents:httpasyncclient-osgi:jar:4.1.2"
-artifact_map[str(Label("@org_apache_httpcomponents_httpcore_nio//jar"))] = "mvn:org.apache.httpcomponents:httpcore-nio:jar:4.4.4"
+artifact_map[str(Label("@org_apache_httpcomponents_httpcore_nio//jar"))] = "mvn:org.apache.httpcomponents:httpcore-nio:jar:NON-OSGI:4.4.4"
 artifact_map[str(Label("@org_apache_karaf_jaas//jar"))] = "mvn:org.apache.karaf.jaas:org.apache.karaf.jaas.modules:jar:3.0.8"
 artifact_map[str(Label("@org_apache_karaf_system_core//jar"))] = "mvn:org.apache.karaf.system:org.apache.karaf.system.core:jar:3.0.8"
 artifact_map[str(Label("@org_apache_servicemix_bundles_snmp4j//jar"))] = "mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.snmp4j:jar:2.3.4_1"
@@ -2212,21 +2212,21 @@
 artifact_map[str(Label("@osgi_core//jar"))] = "mvn:org.osgi:org.osgi.core:jar:5.0.0"
 artifact_map[str(Label("@reflectasm//jar"))] = "mvn:com.esotericsoftware:reflectasm:jar:1.11.0"
 artifact_map[str(Label("@remotetea_oncrpc//jar"))] = "mvn:org.acplt.remotetea:remotetea-oncrpc:jar:1.1.3"
-artifact_map[str(Label("@rrd4j//jar"))] = "mvn:org.rrd4j:rrd4j:jar:3.1"
+artifact_map[str(Label("@rrd4j//jar"))] = "mvn:org.rrd4j:rrd4j:jar:NON-OSGI:3.1"
 artifact_map[str(Label("@javassist//jar"))] = "mvn:org.javassist:javassist:jar:3.22.0-GA"
 artifact_map[str(Label("@mimepull//jar"))] = "mvn:org.jvnet.mimepull:mimepull:jar:1.9.6"
-artifact_map[str(Label("@servlet_api//jar"))] = "mvn:javax.servlet:servlet-api:jar:2.5"
+artifact_map[str(Label("@servlet_api//jar"))] = "mvn:javax.servlet:servlet-api:jar:NON-OSGI:2.5"
 artifact_map[str(Label("@slf4j_api//jar"))] = "mvn:org.slf4j:slf4j-api:jar:1.7.25"
 artifact_map[str(Label("@slf4j_jdk14//jar"))] = "mvn:org.slf4j:slf4j-jdk14:jar:1.7.25"
 artifact_map[str(Label("@typesafe_config//jar"))] = "mvn:com.typesafe:config:jar:1.2.1"
 artifact_map[str(Label("@validation_api//jar"))] = "mvn:javax.validation:validation-api:jar:1.1.0.Final"
-artifact_map[str(Label("@checkstyle//jar"))] = "mvn:com.puppycrawl.tools:checkstyle:jar:8.10"
+artifact_map[str(Label("@checkstyle//jar"))] = "mvn:com.puppycrawl.tools:checkstyle:jar:NON-OSGI:8.10"
 artifact_map[str(Label("@apache_karaf//jar"))] = "http://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/3.0.8/apache-karaf-offline-3.0.8.tar.gz"
 artifact_map[str(Label("@apache_karaf_patches//jar"))] = "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[str(Label("@bndlib//jar"))] = "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:3.1.0"
 artifact_map[str(Label("@bndexe//jar"))] = "mvn:biz.aQute.bnd:biz.aQute.bnd:jar:3.1.0"
 artifact_map[str(Label("@libthrift//jar"))] = "mvn:org.apache.thrift:libthrift:jar:0.9.3"
-artifact_map[str(Label("@qdox//jar"))] = "mvn:com.thoughtworks.qdox:qdox:jar:2.0-M3"
+artifact_map[str(Label("@qdox//jar"))] = "mvn:com.thoughtworks.qdox:qdox:jar:NON-OSGI:2.0-M3"
 artifact_map[str(Label("@org_apache_felix_scr_bnd//jar"))] = "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"
 artifact_map[str(Label("@snmp_core//jar"))] = "mvn:org.onosproject:snmp-core:jar:1.3-20161021.1"
 artifact_map[str(Label("@mibs_net_snmp//jar"))] = "mvn:org.onosproject:mibbler-mibs-net-snmp:jar:1.0-20151221.1"
@@ -2246,33 +2246,33 @@
 artifact_map[str(Label("@onos_yang_serializers_xml//jar"))] = "mvn:org.onosproject:onos-yang-serializers-xml:jar:2.4.7"
 artifact_map[str(Label("@onos_yang_serializers_utils//jar"))] = "mvn:org.onosproject:onos-yang-serializers-utils:jar:2.4.7"
 artifact_map[str(Label("@org_apache_servicemix_bundles_dom4j//jar"))] = "mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.dom4j:jar:1.6.1_5"
-artifact_map[str(Label("@plexus_utils//jar"))] = "mvn:org.codehaus.plexus:plexus-utils:jar:3.0.24"
+artifact_map[str(Label("@plexus_utils//jar"))] = "mvn:org.codehaus.plexus:plexus-utils:jar:NON-OSGI:3.0.24"
 artifact_map[str(Label("@sshd_core//jar"))] = "mvn:org.apache.sshd:sshd-core:jar:1.4.0"
-artifact_map[str(Label("@grpc_core_1_3_1//jar"))] = "mvn:io.grpc:grpc-core:jar:1.3.1"
-artifact_map[str(Label("@grpc_protobuf_1_3_1//jar"))] = "mvn:io.grpc:grpc-protobuf:jar:1.3.1"
-artifact_map[str(Label("@grpc_protobuf_lite_1_3_1//jar"))] = "mvn:io.grpc:grpc-protobuf-lite:jar:1.3.1"
-artifact_map[str(Label("@grpc_stub_1_3_1//jar"))] = "mvn:io.grpc:grpc-stub:jar:1.3.1"
-artifact_map[str(Label("@grpc_netty_1_3_1//jar"))] = "mvn:io.grpc:grpc-netty:jar:1.3.1"
-artifact_map[str(Label("@grpc_auth_1_3_1//jar"))] = "mvn:io.grpc:grpc-auth:jar:1.3.1"
+artifact_map[str(Label("@grpc_core_1_3_1//jar"))] = "mvn:io.grpc:grpc-core:jar:NON-OSGI:1.3.1"
+artifact_map[str(Label("@grpc_protobuf_1_3_1//jar"))] = "mvn:io.grpc:grpc-protobuf:jar:NON-OSGI:1.3.1"
+artifact_map[str(Label("@grpc_protobuf_lite_1_3_1//jar"))] = "mvn:io.grpc:grpc-protobuf-lite:jar:NON-OSGI:1.3.1"
+artifact_map[str(Label("@grpc_stub_1_3_1//jar"))] = "mvn:io.grpc:grpc-stub:jar:NON-OSGI:1.3.1"
+artifact_map[str(Label("@grpc_netty_1_3_1//jar"))] = "mvn:io.grpc:grpc-netty:jar:NON-OSGI:1.3.1"
+artifact_map[str(Label("@grpc_auth_1_3_1//jar"))] = "mvn:io.grpc:grpc-auth:jar:NON-OSGI:1.3.1"
 artifact_map[str(Label("@protobuf_java_3_3_0//jar"))] = "mvn:com.google.protobuf:protobuf-java:jar:3.3.0"
 artifact_map[str(Label("@protobuf_java_3_2_0//jar"))] = "mvn:com.google.protobuf:protobuf-java:jar:3.2.0"
-artifact_map[str(Label("@grpc_testing_1_3_1//jar"))] = "mvn:io.grpc:grpc-testing:jar:1.3.1"
-artifact_map[str(Label("@grpc_testing_proto_1_3_1//jar"))] = "mvn:io.grpc:grpc-testing-proto:jar:1.3.1"
-artifact_map[str(Label("@grpc_context_1_3_1//jar"))] = "mvn:io.grpc:grpc-context:jar:1.3.1"
-artifact_map[str(Label("@google_truth_0_28//jar"))] = "mvn:com.google.truth:truth:jar:0.28"
-artifact_map[str(Label("@google_code_findbugs_3_0_0//jar"))] = "mvn:com.google.code.findbugs:jsr305:jar:3.0.0"
-artifact_map[str(Label("@google_errorprone_2_0_19//jar"))] = "mvn:com.google.errorprone:error_prone_annotations:jar:2.0.19"
-artifact_map[str(Label("@google_instrumentation_0_3_0//jar"))] = "mvn:com.google.instrumentation:instrumentation-api:jar:0.3.0"
+artifact_map[str(Label("@grpc_testing_1_3_1//jar"))] = "mvn:io.grpc:grpc-testing:jar:NON-OSGI:1.3.1"
+artifact_map[str(Label("@grpc_testing_proto_1_3_1//jar"))] = "mvn:io.grpc:grpc-testing-proto:jar:NON-OSGI:1.3.1"
+artifact_map[str(Label("@grpc_context_1_3_1//jar"))] = "mvn:io.grpc:grpc-context:jar:NON-OSGI:1.3.1"
+artifact_map[str(Label("@google_truth_0_28//jar"))] = "mvn:com.google.truth:truth:jar:NON-OSGI:0.28"
+artifact_map[str(Label("@google_code_findbugs_3_0_0//jar"))] = "mvn:com.google.code.findbugs:jsr305:jar:NON-OSGI:3.0.0"
+artifact_map[str(Label("@google_errorprone_2_0_19//jar"))] = "mvn:com.google.errorprone:error_prone_annotations:jar:NON-OSGI:2.0.19"
+artifact_map[str(Label("@google_instrumentation_0_3_0//jar"))] = "mvn:com.google.instrumentation:instrumentation-api:jar:NON-OSGI:0.3.0"
 artifact_map[str(Label("@bcpkix_jdk15on//jar"))] = "mvn:org.bouncycastle:bcpkix-jdk15on:jar:1.59"
 artifact_map[str(Label("@bcprov_jdk15on//jar"))] = "mvn:org.bouncycastle:bcprov-jdk15on:jar:1.59"
-artifact_map[str(Label("@hamcrest_optional//jar"))] = "mvn:com.spotify:hamcrest-optional:jar:1.1.0"
+artifact_map[str(Label("@hamcrest_optional//jar"))] = "mvn:com.spotify:hamcrest-optional:jar:NON-OSGI:1.1.0"
 artifact_map[str(Label("@swagger_annotations//jar"))] = "mvn:io.swagger:swagger-annotations:jar:1.5.16"
 artifact_map[str(Label("@kafka_clients//jar"))] = "mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.kafka-clients:jar:0.8.2.2_1"
-artifact_map[str(Label("@tinder_xmpp//jar"))] = "mvn:org.igniterealtime:tinder:jar:1.3.0"
+artifact_map[str(Label("@tinder_xmpp//jar"))] = "mvn:org.igniterealtime:tinder:jar:NON-OSGI:1.3.0"
 artifact_map[str(Label("@aalto_xml//jar"))] = "mvn:com.fasterxml:aalto-xml:jar:1.0.0"
 artifact_map[str(Label("@stax2_api//jar"))] = "mvn:org.codehaus.woodstox:stax2-api:jar:4.0.0"
-artifact_map[str(Label("@concurrent_hashmap//jar"))] = "mvn:com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.0"
-artifact_map[str(Label("@gnu_idn//jar"))] = "mvn:org.gnu.inet:libidn:jar:1.15"
+artifact_map[str(Label("@concurrent_hashmap//jar"))] = "mvn:com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:NON-OSGI:1.0"
+artifact_map[str(Label("@gnu_idn//jar"))] = "mvn:org.gnu.inet:libidn:jar:NON-OSGI:1.15"
 artifact_map[str(Label("@sigar//jar"))] = "mvn:org.knowhowlab.osgi:sigar:jar:1.6.5_01"
 
 def maven_coordinates(label):
diff --git a/tools/build/bazel/onos_app.py b/tools/build/bazel/onos_app.py
index 7b817d0..36552a0 100755
--- a/tools/build/bazel/onos_app.py
+++ b/tools/build/bazel/onos_app.py
@@ -36,7 +36,7 @@
 
 def mvnUrl(bundle):
     #mvn-uri := 'mvn:' [ repository-url '!' ] group-id '/' artifact-id [ '/' [version] [ '/' [type] [ '/' classifier ] ] ] ]
-    parts = bundle.split(':')
+    parts = bundle.split(':')[1:]
     prefix = 'mvn:'
     suffix = ''
     if len(parts) > 3:
diff --git a/tools/build/bazel/osgi_features.bzl b/tools/build/bazel/osgi_features.bzl
index 10700a5..424e1a7 100644
--- a/tools/build/bazel/osgi_features.bzl
+++ b/tools/build/bazel/osgi_features.bzl
@@ -116,7 +116,7 @@
     for dep in ctx.attr.exported_features:
         for f in dep.files.to_list():
             inputs += [f]
-            cmd += "cat %s;" % f.path
+            cmd += "cat %s;" % f.path if f.path.endswith(".xml") else ""
     cmd += "echo '%s') > %s;" % (FEATURES_FOOTER, output.path)
 
     ctx.actions.run_shell(
diff --git a/tools/build/libgen/src/main/java/org/onosproject/libgen/BuckArtifact.java b/tools/build/libgen/src/main/java/org/onosproject/libgen/BuckArtifact.java
index b6665d5..be336c8 100644
--- a/tools/build/libgen/src/main/java/org/onosproject/libgen/BuckArtifact.java
+++ b/tools/build/libgen/src/main/java/org/onosproject/libgen/BuckArtifact.java
@@ -58,6 +58,8 @@
 
     abstract String url();
 
+    abstract String url(boolean withClassifier);
+
     private String jarTarget() {
         return name != null ? name() : fileName();
     }
@@ -183,6 +185,11 @@
         String url() {
             return url;
         }
+
+        @Override
+        String url(boolean withClassifier) {
+            return url;
+        }
     }
 
     private static class MavenArtifact extends BuckArtifact {
@@ -213,6 +220,18 @@
             return mvnUrl.toString();
         }
 
+        @Override
+        String url(boolean withClassifier) {
+            String url = url();
+            if (withClassifier && !isOsgiReady()) {
+                int i = url.lastIndexOf(':');
+                if (i > 0) {
+                    url = url.substring(0, i) + ":NON-OSGI" + url.substring(i);
+                }
+            }
+            return url;
+        }
+
         //FIXME get sources jars
 
         @Override
diff --git a/tools/build/libgen/src/main/java/org/onosproject/libgen/BuckLibGenerator.java b/tools/build/libgen/src/main/java/org/onosproject/libgen/BuckLibGenerator.java
index 82ca1cc..ed4c625 100644
--- a/tools/build/libgen/src/main/java/org/onosproject/libgen/BuckLibGenerator.java
+++ b/tools/build/libgen/src/main/java/org/onosproject/libgen/BuckLibGenerator.java
@@ -203,7 +203,7 @@
         artifactMap.append("\nartifact_map = {}");
 
         artifacts.forEach(artifact -> {
-            artifactMap.append("\nartifact_map[str(Label(\"" + artifact.bazelExport() + "\"))] = \"" + artifact.url() + "\"");
+            artifactMap.append("\nartifact_map[str(Label(\"" + artifact.bazelExport() + "\"))] = \"" + artifact.url(true) + "\"");
         });
 
         artifactMap.append("\n\ndef maven_coordinates(label):\n" +
diff --git a/tools/package/onos-run-karaf b/tools/package/onos-run-karaf
index b957214..1b53640 100755
--- a/tools/package/onos-run-karaf
+++ b/tools/package/onos-run-karaf
@@ -5,12 +5,12 @@
 
 ONOS_TAR=
 
-cd /tmp
+[ -f $ONOS_TAR ] || (echo "$ONOS_TAR not found" && exit 1)
 
 # Kill any running instances
 [ -f /tmp/onos.pid ] && kill -9 $(cat /tmp/onos.pid) &>/dev/null
 
-ONOS_DIR=$(tar tf $ONOS_TAR | head -n 1 | cut -d/ -f1)
+ONOS_DIR=/tmp/$(tar tf $ONOS_TAR | head -n 1 | cut -d/ -f1)
 ONOS_MD5=$ONOS_DIR/CHECKSUM
 
 # Extract MD5 of the ONOS tar file and of the previous installation, if one exists
@@ -38,25 +38,21 @@
     rm -fr $ONOS_DIR
 
     # Unroll new image from the specified tar file
-    [ -f $ONOS_TAR ] && tar zxf $ONOS_TAR
+    [ -f $ONOS_TAR ] && tar zxf $ONOS_TAR -C /tmp
 
     # Write out this installation's MD5 checksum
     echo "$newMD5" > $ONOS_MD5
 
-    # Change into the ONOS home directory
-    cd $ONOS_DIR
-    export ONOS_HOME=$PWD
-
     # Run using the secure SSH client
     [ ! -f ~/.ssh/id_rsa.pub ] && ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' -q
-    $ONOS_HOME/bin/onos-user-key $(id -un) "$(cut -d\  -f2 ~/.ssh/id_rsa.pub)"
-    $ONOS_HOME/bin/onos-user-password onos rocks
+    $ONOS_DIR/bin/onos-user-key $(id -un) "$(cut -d\  -f2 ~/.ssh/id_rsa.pub)"
+    $ONOS_DIR/bin/onos-user-password onos rocks
 
     # Create config/cluster.json (cluster metadata)
     IP=${ONOS_IP:-127.0.0.1}
     echo "Creating local cluster configs for IP $IP..."
-    [ -d $ONOS_HOME/config ] || mkdir -p $ONOS_HOME/config
-    cat > $ONOS_HOME/config/cluster.json <<-EOF
+    [ -d $ONOS_DIR/config ] || mkdir -p $ONOS_DIR/config
+    cat > $ONOS_DIR/config/cluster.json <<-EOF
     {
       "name": "default",
       "nodes": [ {"id": "$IP", "ip": "$IP", "port": 9876 } ],
@@ -70,12 +66,12 @@
 else
     # Otherwise, run using the previous installation
     echo "Running previous installation..."
-
-    # Change into the ONOS home directory
-    cd $ONOS_DIR
-    export ONOS_HOME=$PWD
 fi
 
+# Change into the ONOS home directory
+cd $ONOS_DIR
+export ONOS_HOME=$PWD
+
 # Start ONOS as a server, but include any specified options
 ./bin/onos-service server "$@" &>onos.log &
 echo "$!" > /tmp/onos.pid