Starting to include kafka-integration app as part of Buck build.

- refactored to follow the api & app structure
- added buck files
- builds and loads
- cleaned-up and fixed number of pom files to function as expected
      (meaning "mvn clean install" actually works)

Change-Id: Ib896269c4986f6ee5cd6bae7cf508f71b64f59f9
diff --git a/apps/cfm/BUCK b/apps/cfm/BUCK
index b1c299d..6e2c44a 100644
--- a/apps/cfm/BUCK
+++ b/apps/cfm/BUCK
@@ -26,7 +26,7 @@
 
 onos_app (
     title = 'Layer 2 Monitoring CFM Application',
-    category = 'default',
+    category = 'Utility',
     url = 'http://onosproject.org',
     description = 'Layer 2 Monitoring Connectivity Fault Management App',
 )
diff --git a/apps/cfm/pom.xml b/apps/cfm/pom.xml
index db53ba8..9036ba1 100644
--- a/apps/cfm/pom.xml
+++ b/apps/cfm/pom.xml
@@ -86,6 +86,12 @@
         </dependency>
 
         <dependency>
+            <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+            <artifactId>jersey-test-framework-provider-jetty</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onos-rest</artifactId>
             <version>${project.version}</version>
diff --git a/apps/configsync-netconf/pom.xml b/apps/configsync-netconf/pom.xml
index bd664b7..4f832bc 100644
--- a/apps/configsync-netconf/pom.xml
+++ b/apps/configsync-netconf/pom.xml
@@ -87,7 +87,7 @@
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-osgi</artifactId>
-            </dependency>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.felix</groupId>
@@ -109,6 +109,13 @@
 
         <dependency>
             <groupId>org.onosproject</groupId>
+            <artifactId>onlab-junit</artifactId>
+            <scope>test</scope>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <scope>test</scope>
             <classifier>tests</classifier>
diff --git a/apps/configsync/pom.xml b/apps/configsync/pom.xml
index 03c1705..270dda3 100644
--- a/apps/configsync/pom.xml
+++ b/apps/configsync/pom.xml
@@ -103,6 +103,13 @@
 
         <dependency>
             <groupId>org.onosproject</groupId>
+            <artifactId>onlab-junit</artifactId>
+            <scope>test</scope>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <scope>test</scope>
             <classifier>tests</classifier>
diff --git a/apps/kafka-integration/BUCK b/apps/kafka-integration/BUCK
new file mode 100644
index 0000000..ecb06ff
--- /dev/null
+++ b/apps/kafka-integration/BUCK
@@ -0,0 +1,17 @@
+BUNDLES = [
+    '//lib:kafka-clients',
+    '//lib:protobuf-java-3.2.0',
+    '//incubator/protobuf/models:onos-incubator-protobuf-models',
+    '//incubator/protobuf/models:onos-incubator-protobuf-models-proto',
+    '//apps/kafka-integration/api:onos-apps-kafka-integration-api',
+    '//apps/kafka-integration/app:onos-apps-kafka-integration-app',
+]
+
+onos_app (
+  title = 'Kafka Integration',
+  category = 'Integration',
+  url = 'http://onosproject.org',
+  description = 'Provides integration of ONOS and Kafka message bus so that internal ONOS events ' +
+    'can be broadcast over the Kafka message bus to off-platform applications.',
+  included_bundles = BUNDLES,
+)
diff --git a/apps/kafka-integration/api/BUCK b/apps/kafka-integration/api/BUCK
new file mode 100644
index 0000000..4609fe9
--- /dev/null
+++ b/apps/kafka-integration/api/BUCK
@@ -0,0 +1,8 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//lib:kafka-clients',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+)
\ No newline at end of file
diff --git a/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/EventSubscriptionService.java b/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/EventSubscriptionService.java
index 1f08b55..b725f0f 100644
--- a/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/EventSubscriptionService.java
+++ b/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/EventSubscriptionService.java
@@ -50,8 +50,8 @@
      * Allows registered listener to subscribe for a specific event type.
      *
      * @param subscriber Subscription data containing the event type
-     * @throws InvalidGroupIdException
-     * @throws InvalidApplicationException
+     * @throws InvalidGroupIdException if the subscriber group is duplicate
+     * @throws InvalidApplicationException if the application has not been registered
      */
     void subscribe(EventSubscriber subscriber)
             throws InvalidGroupIdException, InvalidApplicationException;
@@ -60,8 +60,8 @@
      * Allows the registered listener to unsubscribe for a specific event.
      *
      * @param subscriber Subscription data containing the event type
-     * @throws InvalidGroupIdException
-     * @throws InvalidApplicationException
+     * @throws InvalidGroupIdException if the subscriber group does not exist
+     * @throws InvalidApplicationException if the application has not been registered
      */
     void unsubscribe(EventSubscriber subscriber)
             throws InvalidGroupIdException, InvalidApplicationException;
diff --git a/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/KafkaEventStorageService.java b/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/KafkaEventStorageService.java
index 9f8880d..0631504 100644
--- a/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/KafkaEventStorageService.java
+++ b/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/KafkaEventStorageService.java
@@ -26,7 +26,7 @@
     /**
      * Inserts the Onos Event into Distributed Work Queue.
      *
-     * @param e the ONOS Event
+     * @param event the ONOS Event
      */
     void publishEvent(OnosEvent event);
 
diff --git a/apps/kafka-integration/app/BUCK b/apps/kafka-integration/app/BUCK
new file mode 100644
index 0000000..46cc863
--- /dev/null
+++ b/apps/kafka-integration/app/BUCK
@@ -0,0 +1,30 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//lib:JACKSON',
+    '//lib:KRYO',
+    '//lib:javax.ws.rs-api',
+    '//lib:org.apache.karaf.shell.console',
+    '//apps/kafka-integration/api:onos-apps-kafka-integration-api',
+    '//utils/rest:onlab-rest',
+    '//core/store/serializers:onos-core-serializers',
+    '//cli:onos-cli',
+    '//lib:kafka-clients',
+    '//lib:protobuf-java-3.2.0',
+    '//lib:GRPC_1.3',
+    '//incubator/protobuf/models:onos-incubator-protobuf-models',
+    '//incubator/protobuf/models:onos-incubator-protobuf-models-proto',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+    web_context = '/onos/kafka-integration',
+    api_title = 'Kafka Integration',
+    api_version = '1.0',
+    api_description = 'REST API for Kafka Integration',
+    api_package = 'org.onosproject.kafkaintegration.rest',
+)
diff --git a/apps/kafka-integration/app/app.xml b/apps/kafka-integration/app/app.xml
index 602bb9e..96b5458 100644
--- a/apps/kafka-integration/app/app.xml
+++ b/apps/kafka-integration/app/app.xml
@@ -19,9 +19,7 @@
      featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
      features="${project.artifactId}" apps="org.onosproject.incubator.protobuf">
     <description>${project.description}</description>
-
     <artifact>mvn:${project.groupId}/onos-app-kafka-api/${project.version}</artifact>
-    <artifact>mvn:${project.groupId}/onos-app-kafka-core/${project.version}</artifact>
-    <artifact>mvn:${project.groupId}/onos-app-kafka-web/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-app-kafka-app/${project.version}</artifact>
     <artifact>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.kafka-clients/0.8.2.2_1</artifact>
 </app>
diff --git a/apps/kafka-integration/app/features.xml b/apps/kafka-integration/app/features.xml
index 09380ba..c615f60 100644
--- a/apps/kafka-integration/app/features.xml
+++ b/apps/kafka-integration/app/features.xml
@@ -19,8 +19,7 @@
              description="${project.description}">
         <feature>onos-api</feature>
         <bundle>mvn:${project.groupId}/onos-app-kafka-api/${project.version}</bundle>
-        <bundle>mvn:${project.groupId}/onos-app-kafka-core/${project.version}</bundle>
-        <bundle>mvn:${project.groupId}/onos-app-kafka-web/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-app-kafka-app/${project.version}</bundle>
         <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.kafka-clients/0.8.2.2_1</bundle>
     </feature>
 </features>
diff --git a/apps/kafka-integration/app/pom.xml b/apps/kafka-integration/app/pom.xml
index fb81cf9..36f200d 100644
--- a/apps/kafka-integration/app/pom.xml
+++ b/apps/kafka-integration/app/pom.xml
@@ -17,6 +17,7 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
     <parent>
         <groupId>org.onosproject</groupId>
         <artifactId>onos-kafka</artifactId>
@@ -24,7 +25,12 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>onos-app-kafka</artifactId>
+    <artifactId>onos-app-kafka-app</artifactId>
+    <packaging>bundle</packaging>
+
+    <url>http://onosproject.org</url>
+
+    <description>Kafka Integration Application</description>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -32,21 +38,20 @@
         <onos.app.name>org.onosproject.kafkaintegration</onos.app.name>
         <onos.app.title>Kafka Integration Application</onos.app.title>
         <onos.app.origin>Calix, Inc.</onos.app.origin>
-        <web.context>/onos/kafka</web.context>
-        <api.version>1.0.0</api.version>
-        <api.package>org.onosproject.kafkaintegration.rest</api.package>
         <onos.app.category>Utility</onos.app.category>
         <onos.app.url>https://wiki.onosproject.org/display/ONOS/Kafka+Integration</onos.app.url>
-        <onos.app.requires>org.onosproject.incubator.protobuf</onos.app.requires>
+        <onos.app.requires>org.onosproject.grpc.nb.service</onos.app.requires>
+        <web.context>/onos/kafka</web.context>
+        <api.version>1.0.0</api.version>
+        <api.title>Kafka Integration Application REST API</api.title>
+        <api.package>org.onosproject.kafkaintegration.rest</api.package>
     </properties>
 
-    <packaging>pom</packaging>
-    <description>
-        Kafka Integration Application.
-        This will export ONOS Events to Northbound Kafka Server.
-    </description>
-
     <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-api</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
@@ -55,23 +60,97 @@
         </dependency>
 
         <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-app-kafka-core</artifactId>
-            <version>${project.version}</version>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
         </dependency>
 
         <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-app-kafka-web</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!--Also need to update the app.xml and the features.xml -->
-        <dependency>
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.kafka-clients</artifactId>
             <version>0.8.2.2_1</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-incubator-protobuf-models</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-core-serializers</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-rest</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-rest</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.containers</groupId>
+            <artifactId>jersey-container-servlet</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+        </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <_wab>src/main/webapp/</_wab>
+                        <Include-Resource>
+                            WEB-INF/classes/apidoc/swagger.json=target/swagger.json,
+                            {maven-resources}
+                        </Include-Resource>
+                        <Bundle-SymbolicName>
+                            ${project.groupId}.${project.artifactId}
+                        </Bundle-SymbolicName>
+                        <Import-Package>
+                            *,org.glassfish.jersey.servlet
+                        </Import-Package>
+                        <Web-ContextPath>${web.context}</Web-ContextPath>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
\ No newline at end of file
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/ConversionFactory.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/ConversionFactory.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/ConversionFactory.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/ConversionFactory.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/DeviceEventConverter.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/DeviceEventConverter.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/DeviceEventConverter.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/DeviceEventConverter.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/EventConverter.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/EventConverter.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/EventConverter.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/EventConverter.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/LinkEventConverter.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/LinkEventConverter.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/LinkEventConverter.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/LinkEventConverter.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/package-info.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/package-info.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/converter/package-info.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/converter/package-info.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/EventConversionManager.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/EventConversionManager.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/EventConversionManager.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/EventConversionManager.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/EventSubscriptionManager.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/EventSubscriptionManager.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/EventSubscriptionManager.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/EventSubscriptionManager.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/KafkaCodecRegistrator.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/KafkaCodecRegistrator.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/KafkaCodecRegistrator.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/KafkaCodecRegistrator.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/KafkaStorageManager.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/KafkaStorageManager.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/KafkaStorageManager.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/KafkaStorageManager.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/SubscriberCodec.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/SubscriberCodec.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/SubscriberCodec.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/SubscriberCodec.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/package-info.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/package-info.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/impl/package-info.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/impl/package-info.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/EventListener.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/EventListener.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/EventListener.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/EventListener.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/EventPublisher.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/EventPublisher.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/EventPublisher.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/EventPublisher.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/KafkaConfigManager.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/KafkaConfigManager.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/KafkaConfigManager.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/KafkaConfigManager.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/PublishManager.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/PublishManager.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/PublishManager.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/PublishManager.java
diff --git a/apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/package-info.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/package-info.java
similarity index 100%
rename from apps/kafka-integration/core/src/main/java/org/onosproject/kafkaintegration/kafka/package-info.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/kafka/package-info.java
diff --git a/apps/kafka-integration/web/src/main/java/org/onosproject/kafkaintegration/rest/EventExporterWebResource.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/rest/EventExporterWebResource.java
similarity index 100%
rename from apps/kafka-integration/web/src/main/java/org/onosproject/kafkaintegration/rest/EventExporterWebResource.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/rest/EventExporterWebResource.java
diff --git a/apps/kafka-integration/web/src/main/java/org/onosproject/kafkaintegration/rest/package-info.java b/apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/rest/package-info.java
similarity index 100%
rename from apps/kafka-integration/web/src/main/java/org/onosproject/kafkaintegration/rest/package-info.java
rename to apps/kafka-integration/app/src/main/java/org/onosproject/kafkaintegration/rest/package-info.java
diff --git a/apps/kafka-integration/web/src/main/resources/definitions/KafkaRegistration.json b/apps/kafka-integration/app/src/main/resources/definitions/KafkaRegistration.json
similarity index 100%
rename from apps/kafka-integration/web/src/main/resources/definitions/KafkaRegistration.json
rename to apps/kafka-integration/app/src/main/resources/definitions/KafkaRegistration.json
diff --git a/apps/kafka-integration/web/src/main/resources/definitions/KafkaSubscription.json b/apps/kafka-integration/app/src/main/resources/definitions/KafkaSubscription.json
similarity index 100%
rename from apps/kafka-integration/web/src/main/resources/definitions/KafkaSubscription.json
rename to apps/kafka-integration/app/src/main/resources/definitions/KafkaSubscription.json
diff --git a/apps/kafka-integration/web/src/main/webapp/WEB-INF/web.xml b/apps/kafka-integration/app/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from apps/kafka-integration/web/src/main/webapp/WEB-INF/web.xml
rename to apps/kafka-integration/app/src/main/webapp/WEB-INF/web.xml
diff --git a/apps/kafka-integration/core/pom.xml b/apps/kafka-integration/core/pom.xml
deleted file mode 100644
index f90f451..0000000
--- a/apps/kafka-integration/core/pom.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2016-present Open Networking Foundation
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-    <parent>
-        <groupId>org.onosproject</groupId>
-        <artifactId>onos-kafka</artifactId>
-        <version>1.13.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>onos-app-kafka-core</artifactId>
-
-    <packaging>bundle</packaging>
-    <description>
-        Kafka Integration Application.
-        This module is exclusive of REST calls and is only for the implementation
-        of the Application.
-    </description>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-app-kafka-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.kafka-clients</artifactId>
-            <version>0.8.2.2_1</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-incubator-protobuf-models</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.protobuf</groupId>
-            <artifactId>protobuf-java</artifactId>
-            <version>3.0.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-app-kafka-web</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-            <dependency>
-                <groupId>org.osgi</groupId>
-                <artifactId>org.osgi.compendium</artifactId>
-            </dependency>
-
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generate-scr-srcdescriptor</id>
-                        <goals>
-                            <goal>scr</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file
diff --git a/apps/kafka-integration/pom.xml b/apps/kafka-integration/pom.xml
index 6ad71f0..5c7bb67 100644
--- a/apps/kafka-integration/pom.xml
+++ b/apps/kafka-integration/pom.xml
@@ -31,8 +31,6 @@
 
     <modules>
         <module>api</module>
-        <module>core</module>
-        <module>web</module>
         <module>app</module>
     </modules>
 
diff --git a/apps/kafka-integration/web/pom.xml b/apps/kafka-integration/web/pom.xml
deleted file mode 100644
index 98c6de5..0000000
--- a/apps/kafka-integration/web/pom.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2016-present Open Networking Foundation
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>org.onosproject</groupId>
-        <artifactId>onos-kafka</artifactId>
-        <version>1.13.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>onos-app-kafka-web</artifactId>
-
-    <properties>
-        <web.context>/onos/kafka</web.context>
-        <api.version>1.0.0</api.version>
-        <api.package>org.onosproject.kafkaintegration.rest</api.package>
-        <api.title>Kafka Integration Application REST API</api.title>
-        <api.description>
-            APIs for subscribing to Events generated by ONOS
-        </api.description>
-    </properties>
-
-    <packaging>bundle</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-app-kafka-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-incubator-protobuf-models</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onlab-osgi</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-rest</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-api</artifactId>
-            <classifier>tests</classifier>
-        </dependency>
-
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>javax.ws.rs-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.protobuf</groupId>
-            <artifactId>protobuf-java</artifactId>
-            <version>3.0.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-core-asl</artifactId>
-            <version>1.9.13</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-mapper-asl</artifactId>
-            <version>1.9.13</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.glassfish.jersey.containers</groupId>
-            <artifactId>jersey-container-servlet</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-core-serializers</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>
-                            ${project.groupId}.${project.artifactId}
-                        </Bundle-SymbolicName>
-                        <_wab>src/main/webapp/</_wab>
-                        <Include-Resource>
-                            WEB-INF/classes/apidoc/swagger.json=target/swagger.json,
-                            {maven-resources}
-                        </Include-Resource>
-                        <Import-Package>
-                            org.slf4j,
-                            org.osgi.framework,
-                            javax.ws.rs,
-                            javax.ws.rs.core,
-                            org.glassfish.jersey.servlet,
-                            com.fasterxml.jackson.databind,
-                            com.fasterxml.jackson.databind.node,
-                            com.fasterxml.jackson.core,
-                            org.onlab.packet.*,
-                            org.onosproject.*,
-                            org.onlab.util.*,
-                            com.google.common.*,
-                            com.google.protobuf.*
-                        </Import-Package>
-                        <Web-ContextPath>${web.context}</Web-ContextPath>
-                    </instructions>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generate-scr-srcdescriptor</id>
-                        <goals>
-                            <goal>scr</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.onosproject</groupId>
-                <artifactId>onos-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
diff --git a/apps/rabbitmq/BUCK b/apps/rabbitmq/BUCK
index 69f8c08..3a2fa87 100644
--- a/apps/rabbitmq/BUCK
+++ b/apps/rabbitmq/BUCK
@@ -7,7 +7,9 @@
 ]
 
 BUNDLES = [
-   '//apps/rabbitmq:onos-apps-rabbitmq',
+    '//lib:gson',
+    '//lib:amqp-client',
+    '//apps/rabbitmq:onos-apps-rabbitmq',
 ]
 
 osgi_jar (
@@ -15,8 +17,8 @@
 )
 
 onos_app (
-    title = 'Rabbit MQ APP',
-    category = 'Traffic Steering',
+    title = 'Rabbit MQ Integration',
+    category = 'Integration',
     url = 'http://onosproject.org',
     description = 'Rabbit MQ application.',
     required_apps = [ 'org.onosproject.proxyarp' ],
diff --git a/apps/routeradvertisement/pom.xml b/apps/routeradvertisement/pom.xml
index 8983e14..17d4f38 100644
--- a/apps/routeradvertisement/pom.xml
+++ b/apps/routeradvertisement/pom.xml
@@ -67,6 +67,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-junit</artifactId>
+            <scope>test</scope>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.karaf.shell</groupId>
             <artifactId>org.apache.karaf.shell.console</artifactId>
         </dependency>
diff --git a/apps/t3/BUCK b/apps/t3/BUCK
index cc05798..bca18be 100644
--- a/apps/t3/BUCK
+++ b/apps/t3/BUCK
@@ -14,7 +14,7 @@
 
 onos_app (
     title = 'Trellis Troubleshooting Toolkit',
-    category = 'Utilities',
+    category = 'Utility',
     url = 'http://onosproject.org',
     description = 'Provides static analysis of flows and groups ' +
     'to determine the possible paths a packet may take.',
diff --git a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
index e7ca04b..7e259fb 100644
--- a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
+++ b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
@@ -295,8 +295,10 @@
             case RECEIVED_ROLE_REPLY:
                 ReceivedRoleReply receivedRoleReply = msg.getReceivedRoleReply();
                 deviceProviderService.receivedRoleReply(deviceId(receivedRoleReply.getDeviceId()),
-                        (MastershipRole) MastershipRoleProtoTranslator.translate(receivedRoleReply.getRequested()).get(),
-                        (MastershipRole) MastershipRoleProtoTranslator.translate(receivedRoleReply.getResponse()).get());
+                        (MastershipRole) MastershipRoleProtoTranslator
+                                .translate(receivedRoleReply.getRequested()).get(),
+                        (MastershipRole) MastershipRoleProtoTranslator
+                                .translate(receivedRoleReply.getResponse()).get());
                 break;
             case UPDATE_PORT_STATISTICS:
                 UpdatePortStatistics updatePortStatistics = msg.getUpdatePortStatistics();
diff --git a/lib/BUCK b/lib/BUCK
index 52e68db..574a041 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Tue, 12 Dec 2017 22:46:22 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Thu, 14 Dec 2017 00:27:54 GMT. Do not edit this file manually. *****
 # ***** Use onos-lib-gen *****
 
 pass_thru_pom(
@@ -1508,3 +1508,12 @@
   visibility = [ 'PUBLIC' ],
 )
 
+remote_jar (
+  name = 'kafka-clients',
+  out = 'org.apache.servicemix.bundles.kafka-clients-0.8.2.2_1.jar',
+  url = 'mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.kafka-clients:jar:0.8.2.2_1',
+  sha1 = '19ba66200cc3617fad12843788dff818b9882008',
+  maven_coords = 'org.apache.servicemix.bundles:org.apache.servicemix.bundles.kafka-clients:0.8.2.2_1',
+  visibility = [ 'PUBLIC' ],
+)
+
diff --git a/lib/deps.json b/lib/deps.json
index a1bb91b..057e7ba 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -265,6 +265,7 @@
     "bcpkix-jdk15on": "mvn:org.bouncycastle:bcpkix-jdk15on:1.58",
     "bcprov-jdk15on": "mvn:org.bouncycastle:bcprov-jdk15on:1.58",
     "hamcrest-optional": "mvn:com.spotify:hamcrest-optional:1.1.0",
-    "swagger-annotations": "mvn:io.swagger:swagger-annotations:1.5.16"
+    "swagger-annotations": "mvn:io.swagger:swagger-annotations:1.5.16",
+    "kafka-clients": "mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.kafka-clients:0.8.2.2_1"
   }
 }
diff --git a/modules.defs b/modules.defs
index e00656c..2ae8cfd 100644
--- a/modules.defs
+++ b/modules.defs
@@ -230,6 +230,8 @@
     '//apps/powermanagement:onos-apps-powermanagement-oar',
     '//apps/t3:onos-apps-t3-oar',
     '//apps/simplefabric:onos-apps-simplefabric-oar',
+    '//apps/kafka-integration:onos-apps-kafka-integration-oar',
+    '//apps/rabbitmq:onos-apps-rabbitmq-oar',
 ]
 
 PROTOCOL_APPS = [
@@ -268,6 +270,8 @@
     '//apps/vtn/vtnmgr:onos-apps-vtn-vtnmgr',
     '//apps/vtn/vtnweb:onos-apps-vtn-vtnweb',
 #   '//apps/p4runtime-test:onos-apps-p4runtime-test',
+    '//apps/kafka-integration/api:onos-apps-kafka-integration-api',
+    '//apps/kafka-integration/app:onos-apps-kafka-integration-app',
 ]
 
 APPS = ONOS_DRIVERS + ONOS_PROVIDERS + ONOS_APPS + MODELS + PIPELINES \