Refactor buck external dependencies

Change-Id: Ia4b99493407eb7d4e893804cba6b944f758f085e
diff --git a/lib/BUCK b/lib/BUCK
index de17152..f1774fc 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Fri, 18 Aug 2017 16:55:01 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Mon, 21 Aug 2017 15:52:00 GMT. Do not edit this file manually. *****
 # ***** Use onos-lib-gen *****
 
 pass_thru_pom(
@@ -12,7 +12,6 @@
   name = 'COMPILE',
   visibility = ['PUBLIC'],
   exported_deps = [
-    ':joda-time',
     ':commons-configuration',
     ':commons-logging',
     ':commons-collections',
@@ -20,37 +19,15 @@
     ':commons-lang3',
     ':commons-io',
     ':commons-pool',
-    ':objenesis',
     ':guava',
-    ':netty',
-    ':netty-buffer',
-    ':netty-common',
-    ':minimal-json',
-    ':kryo',
-    ':reflectasm',
-    ':asm',
-    ':minlog',
-    ':metrics-core',
-    ':metrics-json',
     ':slf4j-api',
     ':osgi-core',
     ':org.osgi.compendium',
     ':org.apache.felix.scr.annotations',
     ':org.apache.felix.scr',
-    ':jackson-annotations',
-    ':jackson-core',
-    ':jackson-databind',
     ':org.apache.karaf.features.core',
     ':org.apache.karaf.system.core',
     ':jsr305',
-    ':onos-yang-datamodel',
-    ':onos-yang-utils-generator',
-    ':onos-yang-model',
-    ':onos-yang-compiler-api',
-    ':onos-yang-maven-plugin',
-    ':onos-yang-serializers-json',
-    ':onos-yang-serializers-xml',
-    ':onos-yang-serializers-utils',
     ':org.apache.servicemix.bundles.dom4j',
   ],
 )
@@ -122,6 +99,15 @@
 )
 
 osgi_feature_group(
+  name = 'NETTY',
+  visibility = ['PUBLIC'],
+  exported_deps = [
+    ':netty-buffer',
+    ':netty-common',
+  ],
+)
+
+osgi_feature_group(
   name = 'GRPC_1.3',
   visibility = ['PUBLIC'],
   exported_deps = [
@@ -149,6 +135,51 @@
   ],
 )
 
+osgi_feature_group(
+  name = 'ONOS_YANG',
+  visibility = ['PUBLIC'],
+  exported_deps = [
+    ':onos-yang-datamodel',
+    ':onos-yang-utils-generator',
+    ':onos-yang-model',
+    ':onos-yang-compiler-api',
+    ':onos-yang-serializers-json',
+    ':onos-yang-serializers-xml',
+    ':onos-yang-serializers-utils',
+  ],
+)
+
+osgi_feature_group(
+  name = 'JACKSON',
+  visibility = ['PUBLIC'],
+  exported_deps = [
+    ':jackson-annotations',
+    ':jackson-core',
+    ':jackson-databind',
+  ],
+)
+
+osgi_feature_group(
+  name = 'METRICS',
+  visibility = ['PUBLIC'],
+  exported_deps = [
+    ':metrics-core',
+    ':metrics-json',
+  ],
+)
+
+osgi_feature_group(
+  name = 'KRYO',
+  visibility = ['PUBLIC'],
+  exported_deps = [
+    ':kryo',
+    ':reflectasm',
+    ':asm',
+    ':minlog',
+    ':objenesis',
+  ],
+)
+
 remote_jar (
   name = 'aopalliance-repackaged',
   out = 'aopalliance-repackaged-2.5.0-b32.jar',
diff --git a/lib/deps.json b/lib/deps.json
index 2653b9d..1dd3852 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -1,7 +1,6 @@
 {
   "libraries": {
     "COMPILE": [
-      "joda-time",
       "commons-configuration",
       "commons-logging",
       "commons-collections",
@@ -9,37 +8,15 @@
       "commons-lang3",
       "commons-io",
       "commons-pool",
-      "objenesis",
       "guava",
-      "netty",
-      "netty-buffer",
-      "netty-common",
-      "minimal-json",
-      "kryo",
-      "reflectasm",
-      "asm",
-      "minlog",
-      "metrics-core",
-      "metrics-json",
       "slf4j-api",
       "osgi-core",
       "org.osgi.compendium",
       "org.apache.felix.scr.annotations",
       "org.apache.felix.scr",
-      "jackson-annotations",
-      "jackson-core",
-      "jackson-databind",
       "org.apache.karaf.features.core",
       "org.apache.karaf.system.core",
       { "name": "jsr305", "compile_only": true },
-      "onos-yang-datamodel",
-      "onos-yang-utils-generator",
-      "onos-yang-model",
-      "onos-yang-compiler-api",
-      "onos-yang-maven-plugin",
-      "onos-yang-serializers-json",
-      "onos-yang-serializers-xml",
-      "onos-yang-serializers-utils",
       "org.apache.servicemix.bundles.dom4j"
     ],
     "CORE_DEPS": [
@@ -88,6 +65,10 @@
       "//core/common:onos-core-common-tests",
       "//utils/osgi:onlab-osgi-tests"
     ],
+    "NETTY": [
+      "netty-buffer",
+      "netty-common"
+    ],
     "GRPC_1.3": [
       "grpc-core-1.3.0",
       "grpc-protobuf-1.3.0",
@@ -105,6 +86,31 @@
       "google-instrumentation-0.3.0",
       "junit-dep",
       "objenesis"
+    ],
+    "ONOS_YANG": [
+      "onos-yang-datamodel",
+      "onos-yang-utils-generator",
+      "onos-yang-model",
+      "onos-yang-compiler-api",
+      "onos-yang-serializers-json",
+      "onos-yang-serializers-xml",
+      "onos-yang-serializers-utils"
+    ],
+    "JACKSON": [
+      "jackson-annotations",
+      "jackson-core",
+      "jackson-databind"
+    ],
+    "METRICS": [
+      "metrics-core",
+      "metrics-json"
+    ],
+    "KRYO": [
+      "kryo",
+      "reflectasm",
+      "asm",
+      "minlog",
+      "objenesis"
     ]
   },