update for ONOS 1.10.3 support

Change-Id: I441d387d3e5d20058bdf2ef9050d7fe42cc43234
diff --git a/Makefile b/Makefile
index d595565..3435fb0 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,10 @@
 build:
 	docker build -f Dockerfile.make -t $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(ROOT_DIR)
 
+.PHONY: onos
+onos:
+	docker build -t cord/onos:latest -f docker/Dockerfile.onos .
+
 .PHONY: publish
 publish:
 	docker tag $(IMAGE_NAME):$(DEPLOY_DOCKER_TAG) $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(DEPLOY_DOCKER_TAG)
diff --git a/apps/dependencies.xml b/apps/dependencies.xml
new file mode 100644
index 0000000..ad179c4
--- /dev/null
+++ b/apps/dependencies.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2017-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/maven-v4_0_0.xsd">
+         <modelVersion>4.0.0</modelVersion>
+
+    <groupId>fake</groupId>
+    <artifactId>fake</artifactId>
+    <version>fake</version>
+
+    <properties>
+        <aaa.version>1.3.0-SNAPSHOT</aaa.version>
+        <config.version>1.3.0-SNAPSHOT</config.version>
+        <dhcpl2relay.version>1.1.0-SNAPSHOT</dhcpl2relay.version>
+        <igmp.version>1.3.0-SNAPSHOT</igmp.version>
+        <igmpproxy.version>1.1.0-SNAPSHOT</igmpproxy.version>
+        <mcast.version>1.3.0-SNAPSHOT</mcast.version>
+        <olt.version>1.3.0-SNAPSHOT</olt.version>
+        <sadis.version>1.1.0-SNAPSHOT</sadis.version>
+        <vtn.version>1.3.0-SNAPSHOT</vtn.version>
+
+        <!-- TODO onos-build-conf.version can be dropped when onos.version > 1.10.3 -->
+        <onos-build-conf.version>1.10.3-onf</onos-build-conf.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>aaa</artifactId>
+	    <version>${aaa.version}</version>
+	    <type>oar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>cord-config</artifactId>
+	    <version>${config.version}</version>
+	    <type>oar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>dhcpl2relay</artifactId>
+            <version>${dhcpl2relay.version}</version>
+            <type>oar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>igmp</artifactId>
+            <version>${igmp.version}</version>
+            <type>oar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>onos-app-igmpproxy</artifactId>
+            <version>${igmpproxy.version}</version>
+            <type>oar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>mcast</artifactId>
+            <version>${mcast.version}</version>
+            <type>oar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>olt-app</artifactId>
+            <version>${olt.version}</version>
+            <type>oar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>sadis-app</artifactId>
+            <version>${sadis.version}</version>
+            <type>oar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>vtn</artifactId>
+            <version>${vtn.version}</version>
+            <type>oar</type>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>3.0.1</version>
+            </plugin>
+        </plugins>
+    </build>
+
+    <repositories>
+        <repository>
+            <id>central</id>
+            <name>Central Repository</name>
+            <url>http://repo.maven.apache.org/maven2</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+            <releases>
+                <enabled>true</enabled>
+                <updatePolicy>always</updatePolicy>
+                <checksumPolicy>fail</checksumPolicy>
+            </releases>
+        </repository>
+
+        <repository>
+            <id>snapshots</id>
+            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>always</updatePolicy>
+                <checksumPolicy>fail</checksumPolicy>
+            </snapshots>
+        </repository>
+    </repositories>
+
+</project>
diff --git a/build.gradle b/build.gradle
index 1653236..ce19cf3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -87,12 +87,12 @@
 
 task buildOnosApps (type: Exec) {
     workingDir './apps'
-    commandLine 'mvn', 'clean', 'install', '-U'
+    commandLine 'mvn', 'dependency:copy-dependencies', '-Dmdep.copyPom=false', '-Dmdep.useRepositoryLayout=true', '-DoutputDirectory=m2/repository', '-Dmdep.addParentPoms=false', '-Dtype=oar', '-DexcludeTypes=jar', '-Dsilent=true', '-f', 'dependencies.xml'
 }
 
 task copyLocalRepo (dependsOn: buildOnosApps, type: Exec) {
     workingDir './'
-    commandLine 'cp', '-R', System.env.HOME + '/.m2/repository', '.'
+    commandLine 'cp', '-R', 'apps/m2/repository', '.'
 }
 
 task buildRepoImage (dependsOn: copyLocalRepo, type: Exec) {
diff --git a/config/app-install.sh b/config/app-install.sh
index 4bb8808..ec39263 100644
--- a/config/app-install.sh
+++ b/config/app-install.sh
@@ -13,7 +13,7 @@
     mkdir -p $APP_INSTALL_ROOT
     cd $APP_INSTALL_ROOT
     cp $oar $APP_INSTALL_ROOT
-    jar -xf $APP_INSTALL_ROOT/$(basename $oar)
+    unzip -oq -d . $APP_INSTALL_ROOT/$(basename $oar)
     name=$(grep "name=" $APP_INSTALL_ROOT/app.xml | sed 's/<app name="//g;s/".*//g')
     mkdir -p $APPS_ROOT/$name
     cp $APP_INSTALL_ROOT/app.xml $APPS_ROOT/$name/app.xml
diff --git a/docker/Dockerfile.onos b/docker/Dockerfile.onos
index 18b2842..3a334d1 100644
--- a/docker/Dockerfile.onos
+++ b/docker/Dockerfile.onos
@@ -1,4 +1,4 @@
-FROM onosproject/onos:1.8 as build
+FROM onosproject/onos:1.10.3 as build
 MAINTAINER Open Networking Foundation <info@opennetworking.org>
 
 ENV BUILD_ROOT=/build
@@ -9,21 +9,21 @@
 # must be replicated below to the final image as they are shared between stages
 ENV ONOS=/root/onos
 ENV APPS_ROOT=${ONOS}/apps
-ENV KARAF_VERSION=3.0.5
+ENV KARAF_VERSION=3.0.8
 ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
 ENV KARAF_M2=${KARAF_ROOT}/system
 ENV APP_INSTALL_ROOT=/expand
 
 # Specify application versions to install
-ENV AAA_VERSION=1.2.0-SNAPSHOT \
-	CONFIG_VERSION=1.2.0-SNAPSHOT \
-	IGMP_VERSION=1.2.0-SNAPSHOT \
-	IGMP_PROXY_VERSION=1.0.0-SNAPSHOT \
-	MCAST_VERSION=1.2.0-SNAPSHOT \
-	OLT_VERSION=1.2.0-SNAPSHOT \
-	SADIS_VERSION=1.0.0-SNAPSHOT \
-	VTN_VERSION=1.2.0-SNAPSHOT \
-	L2_DHCP_RELAY_VERSION=1.0.0-SNAPSHOT
+ENV AAA_VERSION=1.3.0-SNAPSHOT \
+	CONFIG_VERSION=1.3.0-SNAPSHOT \
+	IGMP_VERSION=1.3.0-SNAPSHOT \
+	IGMP_PROXY_VERSION=1.1.0-SNAPSHOT \
+	MCAST_VERSION=1.3.0-SNAPSHOT \
+	OLT_VERSION=1.3.0-SNAPSHOT \
+	SADIS_VERSION=1.1.0-SNAPSHOT \
+	VTN_VERSION=1.3.0-SNAPSHOT \
+	L2_DHCP_RELAY_VERSION=1.1.0-SNAPSHOT
 
 ENV APPS="aaa-${AAA_VERSION} \
 	cord-config-${CONFIG_VERSION} \
@@ -42,10 +42,13 @@
 RUN ./app-install.sh
 
 # Create the final image coping over the installed applications from the build stage
-FROM onosproject/onos:1.8
+FROM onosproject/onos:1.10.3
+
+# Install Key Store Options
+ENV JAVA_OPTS="${JAVA_OPTS:--DenableOFTLS=true -Djavax.net.ssl.keyStore=/home/sdn/wiki/onos.jks -Djavax.net.ssl.keyStorePassword=222222 -Djavax.net.ssl.trustStore=/home/sdn/wiki/onos.jks -Djavax.net.ssl.trustStorePassword=222222}"
 
 ENV ONOS=/root/onos
-ENV KARAF_VERSION=3.0.5
+ENV KARAF_VERSION=3.0.8
 ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
 ENV KARAF_M2=${KARAF_ROOT}/system
 ENV APPS_ROOT=${ONOS}/apps
@@ -55,7 +58,12 @@
 COPY --from=build ${APPS_ROOT}/ ${APPS_ROOT}/
 COPY config/netcfg.json $KARAF_ROOT/../config/network-cfg.json
 
-RUN touch $ONOS/apps/org.onosproject.netcfghostprovider/active
-RUN touch $ONOS/apps/org.onosproject.netcfglinksprovider/active
+RUN touch $ONOS/apps/org.onosproject.hostprovider/active
 RUN touch $ONOS/apps/org.onosproject.openflow-base/active
+RUN touch $ONOS/apps/org.onosproject.openflow-base/active
+
+# Create ONOS Key Directory
+RUN mkdir -p /home/sdn/wiki
+COPY docker/onos_cfg/ /home/sdn/wiki
+
 
diff --git a/docker/onos_cfg/onos.jks b/docker/onos_cfg/onos.jks
new file mode 100644
index 0000000..155e29e
--- /dev/null
+++ b/docker/onos_cfg/onos.jks
Binary files differ