[SEBA-870] Bump ONOS to 2.2 and build with Java 11

Change-Id: Id46d7d05ac19bfb86828ab02d2ff1092822cf9ef
diff --git a/pom.xml b/pom.xml
index f61c736..b6e1055 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,20 +22,18 @@
     <parent>
         <groupId>org.onosproject</groupId>
         <artifactId>onos-dependencies</artifactId>
-        <version>1.13.6</version>
-        <relativePath></relativePath>
+        <version>2.2.1-b2</version>
     </parent>
 
     <groupId>org.opencord</groupId>
     <artifactId>cord-config</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <description>CORD configuration meta application</description>
 
     <properties>
         <onos.app.name>org.opencord.config</onos.app.name>
-        <onos.version>1.13.6</onos.version>
         <onos.app.title>CORD Configuration Meta Application</onos.app.title>
         <onos.app.category>Utility</onos.app.category>
         <onos.app.url>http://opencord.org</onos.app.url>
@@ -46,83 +44,15 @@
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.0.1</version>
-                <extensions>true</extensions>
-                <configuration>
-                    <niceManifest>true</niceManifest>
-                    <instructions>
-                      <!-- Any Guava version 19.0 or later-->
-                      <Import-Package>
-                          com.google.*;version=19.0,
-                          *
-                      </Import-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>2.5.1</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.21.0</version>
-                <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>
-                <version>1.11</version>
-                <executions>
-                    <execution>
-                        <id>cfg</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>cfg</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>swagger</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>swagger</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>app</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>app</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
@@ -142,7 +72,6 @@
                 <checksumPolicy>fail</checksumPolicy>
             </releases>
         </repository>
-
         <repository>
             <id>snapshots</id>
             <url>https://oss.sonatype.org/content/repositories/snapshots</url>
diff --git a/src/main/java/org/opencord/cordconfig/CordConfigManager.java b/src/main/java/org/opencord/cordconfig/CordConfigManager.java
index a85f7bb..913f978 100644
--- a/src/main/java/org/opencord/cordconfig/CordConfigManager.java
+++ b/src/main/java/org/opencord/cordconfig/CordConfigManager.java
@@ -17,12 +17,11 @@
 package org.opencord.cordconfig;
 
 import com.google.common.collect.ImmutableSet;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
 import org.onosproject.event.ListenerRegistry;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.config.ConfigFactory;
@@ -47,13 +46,12 @@
 /**
  * Manages the common CORD configuration.
  */
-@Service
 @Component(immediate = true)
 public class CordConfigManager extends ListenerRegistry<CordConfigEvent, CordConfigListener>
         implements CordConfigService {
     private static Logger log = LoggerFactory.getLogger(CordConfigManager.class);
 
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected NetworkConfigRegistry networkConfig;
 
     private Map<DeviceId, AccessDeviceData> accessDevices = new ConcurrentHashMap<>();