Preparing assembly of Karaf and ONOS artifacts for off-line deployments.

Change-Id: I113490bc6735f5372e33bb671ad5adec640b2e36
diff --git a/tools/build/onos-package b/tools/build/onos-package
index 5566e60..5500208 100755
--- a/tools/build/onos-package
+++ b/tools/build/onos-package
@@ -50,16 +50,21 @@
         $ONOS_ROOT/tools/package/bin/onos-client > bin/onos
     chmod a+x bin/onos-service bin/onos
 
-    # Stage the ONOS bundles, but only those that match the version
-    mkdir -p $ONOS_STAGE/$KARAF_DIST/system/org/onosproject
-    find $M2_REPO/org/onosproject -type f -path "*/$ONOS_POM_VERSION/*" \
-        \( -name '*.jar' -o -name '*.pom' -o -name '*-features.xml' \) \
-            | grep -v -Ee '-tests.jar|-[0-9]{8}.[0-9]{6}-' \
-            | while read src; do
-        dst=$ONOS_STAGE/$KARAF_DIST/system/${src#$M2_REPO/*}
-        mkdir -p $(dirname $dst)
-        cp $src $dst
-    done
+    if [ -d $ONOS_ROOT/tools/package/karaf-assembly/target/repo ]; then
+        cp -r $ONOS_ROOT/tools/package/karaf-assembly/target/repo/* $ONOS_STAGE/$KARAF_DIST/system
+    else
+        # TODO: Deprecated so remove when confident staging works.
+        # Stage the ONOS bundles, but only those that match the version
+        mkdir -p $ONOS_STAGE/$KARAF_DIST/system/org/onosproject
+        find $M2_REPO/org/onosproject -type f -path "*/$ONOS_POM_VERSION/*" \
+            \( -name '*.jar' -o -name '*.pom' -o -name '*-features.xml' \) \
+                | grep -v -Ee '-tests.jar|-[0-9]{8}.[0-9]{6}-' \
+                | while read src; do
+            dst=$ONOS_STAGE/$KARAF_DIST/system/${src#$M2_REPO/*}
+            mkdir -p $(dirname $dst)
+            cp $src $dst
+        done
+    fi
 
     # ONOS Patching ----------------------------------------------------------------