Updating onos-release to use staging profile for archetypes

Change-Id: I8e81b7399c747174776b0523df555b57d0d61776
diff --git a/tools/build/onos-release b/tools/build/onos-release
index 774b0de..901425c 100755
--- a/tools/build/onos-release
+++ b/tools/build/onos-release
@@ -37,9 +37,11 @@
 
 # Build ONOS archetypes & deploy to staging repo using the release profile.
 # Note that release of the staging repository is a separate manual step.
+export MVN_CLI_OPTS=-Pstaging
 pushd tools/package/archetypes/
-mvn clean install && onos-archetypes-test && mvn -Prelease clean deploy
+mvn -Pstaging clean install && onos-archetypes-test && mvn -Pstaging -Prelease clean deploy
 popd
+unset MVN_CLI_OPTS
 
 # Commit newly versioned artifacts and issue a tag.
 git commit -a -m"Tagging $NEW_VERSION"
diff --git a/tools/test/bin/onos-archetypes-test b/tools/test/bin/onos-archetypes-test
index 1088d5b..918048d 100755
--- a/tools/test/bin/onos-archetypes-test
+++ b/tools/test/bin/onos-archetypes-test
@@ -25,10 +25,10 @@
 for an in api bundle cli rest ui uitab uitopo; do
     cd $AROOT
     rm -fr $AROOT/foo-$an
-    mvn archetype:generate $ARCHETYPE_OPTS \
+    mvn archetype:generate $MVN_CLI_OPTS $ARCHETYPE_OPTS \
         -DarchetypeArtifactId=onos-$an-archetype \
         -DgroupId=org.foo -DartifactId=foo-$an -Dversion=1.0 \
         -Dpackage=org.foo.$an -DinteractiveMode=false
     cd $AROOT/foo-$an
-    mvn clean install
+    mvn $MVN_CLI_OPTS clean install
 done