Updating Buck files to build OSGi jars

- Using osgi_jar for all modules except apps
- Adding target for installation of core modules to .m2 repo

Change-Id: I65d9e3a9567918e275191724842d7d9b1f485128
diff --git a/providers/bgp/cfg/BUCK b/providers/bgp/cfg/BUCK
index 8c5b713..3156e95 100644
--- a/providers/bgp/cfg/BUCK
+++ b/providers/bgp/cfg/BUCK
@@ -8,7 +8,7 @@
     '//protocols/bgp/api:onos-bgp-api',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/bgp/flow/BUCK b/providers/bgp/flow/BUCK
index b900d14..ba18ec5 100644
--- a/providers/bgp/flow/BUCK
+++ b/providers/bgp/flow/BUCK
@@ -8,7 +8,7 @@
     '//protocols/bgp/api:onos-bgp-api',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/bgp/topology/BUCK b/providers/bgp/topology/BUCK
index 6ea4e5b..59e56f6 100644
--- a/providers/bgp/topology/BUCK
+++ b/providers/bgp/topology/BUCK
@@ -14,7 +14,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/host/BUCK b/providers/host/BUCK
index f8bedb1..80f921c 100644
--- a/providers/host/BUCK
+++ b/providers/host/BUCK
@@ -7,7 +7,7 @@
     '//lib:CORE_DEPS',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/lldp/BUCK b/providers/lldp/BUCK
index dcc091f..3e40240 100644
--- a/providers/lldp/BUCK
+++ b/providers/lldp/BUCK
@@ -13,7 +13,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/lldpcommon/BUCK b/providers/lldpcommon/BUCK
index 2053e29..f4b3b21 100644
--- a/providers/lldpcommon/BUCK
+++ b/providers/lldpcommon/BUCK
@@ -12,7 +12,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/netcfghost/BUCK b/providers/netcfghost/BUCK
index d548290..c0341d1 100644
--- a/providers/netcfghost/BUCK
+++ b/providers/netcfghost/BUCK
@@ -12,7 +12,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/netcfglinks/BUCK b/providers/netcfglinks/BUCK
index 1a92055..e30244e 100644
--- a/providers/netcfglinks/BUCK
+++ b/providers/netcfglinks/BUCK
@@ -13,7 +13,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/netconf/device/BUCK b/providers/netconf/device/BUCK
index 6206f12..74307dd 100644
--- a/providers/netconf/device/BUCK
+++ b/providers/netconf/device/BUCK
@@ -9,7 +9,7 @@
     '//protocols/netconf/api:onos-netconf-api',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/null/BUCK b/providers/null/BUCK
index 0922a76..7ac6ee6 100644
--- a/providers/null/BUCK
+++ b/providers/null/BUCK
@@ -14,7 +14,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/openflow/device/BUCK b/providers/openflow/device/BUCK
index c27bda4..56244d1 100644
--- a/providers/openflow/device/BUCK
+++ b/providers/openflow/device/BUCK
@@ -14,7 +14,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/openflow/flow/BUCK b/providers/openflow/flow/BUCK
index 8413106..cc8ac28 100644
--- a/providers/openflow/flow/BUCK
+++ b/providers/openflow/flow/BUCK
@@ -14,7 +14,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/openflow/group/BUCK b/providers/openflow/group/BUCK
index 6e1f55a..2d176ab 100644
--- a/providers/openflow/group/BUCK
+++ b/providers/openflow/group/BUCK
@@ -15,7 +15,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/openflow/message/BUCK b/providers/openflow/message/BUCK
index 721518c..dff2a84 100644
--- a/providers/openflow/message/BUCK
+++ b/providers/openflow/message/BUCK
@@ -15,7 +15,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/openflow/meter/BUCK b/providers/openflow/meter/BUCK
index a9bea90..9eae14a 100644
--- a/providers/openflow/meter/BUCK
+++ b/providers/openflow/meter/BUCK
@@ -14,7 +14,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/openflow/packet/BUCK b/providers/openflow/packet/BUCK
index bc579ee..b209b2b 100644
--- a/providers/openflow/packet/BUCK
+++ b/providers/openflow/packet/BUCK
@@ -14,7 +14,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/ovsdb/device/BUCK b/providers/ovsdb/device/BUCK
index 7206649..7e1832f 100644
--- a/providers/ovsdb/device/BUCK
+++ b/providers/ovsdb/device/BUCK
@@ -14,7 +14,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/ovsdb/host/BUCK b/providers/ovsdb/host/BUCK
index 38d9121..2cfac8a 100644
--- a/providers/ovsdb/host/BUCK
+++ b/providers/ovsdb/host/BUCK
@@ -14,7 +14,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/ovsdb/tunnel/BUCK b/providers/ovsdb/tunnel/BUCK
index d7bee96..b41d04f 100644
--- a/providers/ovsdb/tunnel/BUCK
+++ b/providers/ovsdb/tunnel/BUCK
@@ -15,7 +15,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/pcep/topology/BUCK b/providers/pcep/topology/BUCK
index f5f0119..6f819d1 100644
--- a/providers/pcep/topology/BUCK
+++ b/providers/pcep/topology/BUCK
@@ -15,7 +15,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/pcep/tunnel/BUCK b/providers/pcep/tunnel/BUCK
index 50969c2..f98afa9 100644
--- a/providers/pcep/tunnel/BUCK
+++ b/providers/pcep/tunnel/BUCK
@@ -18,7 +18,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/rest/device/BUCK b/providers/rest/device/BUCK
index 6b4e2a4..92dabe8 100644
--- a/providers/rest/device/BUCK
+++ b/providers/rest/device/BUCK
@@ -18,7 +18,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/snmp/alarm/BUCK b/providers/snmp/alarm/BUCK
index 0630028..7217309 100644
--- a/providers/snmp/alarm/BUCK
+++ b/providers/snmp/alarm/BUCK
@@ -19,7 +19,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,
diff --git a/providers/snmp/device/BUCK b/providers/snmp/device/BUCK
index 7cbb381..a0d0a69 100644
--- a/providers/snmp/device/BUCK
+++ b/providers/snmp/device/BUCK
@@ -20,7 +20,7 @@
     '//lib:TEST',
 ]
 
-java_library(
+osgi_jar(
     name = CURRENT_NAME,
     srcs = glob([SRC + '/*.java']),
     deps = COMPILE_DEPS,