Moving core/security/BUCK to new, simplified format

Change-Id: Ib3a3a0bf240461ca70f56be24d3459f3ee638e8e
diff --git a/core/security/BUCK b/core/security/BUCK
index cfba040..dc17338 100644
--- a/core/security/BUCK
+++ b/core/security/BUCK
@@ -1,8 +1,3 @@
-SRC = 'src/main/java/org/onosproject/security/**/'
-TEST = 'src/test/java/org/onosproject/security/**/'
-CURRENT_NAME = 'onos-security'
-CURRENT_TARGET = ':' + CURRENT_NAME
-
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
     '//core/store/serializers:onos-core-serializers',
@@ -12,17 +7,9 @@
     '//lib:TEST',
 ]
 
-osgi_jar(
-    name = CURRENT_NAME,
-    srcs = glob([SRC + '/*.java']),
+osgi_jar_with_tests (
+    name = 'onos-security',
     deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
     visibility = ['PUBLIC'],
 )
-
-java_test(
-    name = 'tests',
-    srcs = glob([TEST + '/*.java']),
-    deps = COMPILE_DEPS +
-           TEST_DEPS +
-           [CURRENT_TARGET],
-)