Enhancing onos-release to check for no SNAPSHOTs.

Adding release readiness test script.

Change-Id: Id0e7fe3a83279cf6cf2c5c6cf92048377702894e
diff --git a/tools/build/onos-release b/tools/build/onos-release
index 48676cc..d4c1a80 100755
--- a/tools/build/onos-release
+++ b/tools/build/onos-release
@@ -22,6 +22,9 @@
 onos-change-version $NEW_VERSION
 export ONOS_VERSION=$NEW_VERSION
 
+# Validate integrity of the versioning
+onos-validate-change-version
+
 # Build ONOS & deploy to staging repo using the release profile.
 onos-build && onos-package --tar --zip && mvn -Prelease clean deploy -DskipTests
 
diff --git a/tools/build/onos-validate-change-version b/tools/build/onos-validate-change-version
new file mode 100755
index 0000000..1bf7645
--- /dev/null
+++ b/tools/build/onos-validate-change-version
@@ -0,0 +1,16 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Validates that no pom versions contain SNAPSHOT.
+# -----------------------------------------------------------------------------
+
+[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
+
+aux=/tmp/pom-$$.log
+trap "rm -f $aux 2>/dev/null" EXIT
+
+grep -r SNAPSHOT . | \
+    grep -v -f $(dirname $0)/onos-validate-change-version.excludes > $aux
+
+[ ! -s $aux ] && echo "There are files containing SNAPSHOT references:" && \
+    cat $aux && exit 1
+exit 0
\ No newline at end of file
diff --git a/tools/build/onos-validate-change-version.excludes b/tools/build/onos-validate-change-version.excludes
new file mode 100755
index 0000000..8650872
--- /dev/null
+++ b/tools/build/onos-validate-change-version.excludes
@@ -0,0 +1,24 @@
+\./build.log
+\./.git
+\./target/
+\./tools/build/onos-change-version
+\./tools/build/onos-release
+\./tools/build/onos-snapshot
+
+\./tools/package/archetypes/.*/archetype\.properties
+\./tools/package/maven-plugin/pom.xml
+\./tools/build/conf/pom.xml
+
+\./web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
+\./core/api/src/test/java/org/onosproject/VersionTest.java
+
+\./tools/package/yangtools/pom.xml
+\./tools/package/yangtools/src/main/resources/pom-template.xml
+\./utils/yangutils/pom.xml
+
+\./apps/openstackrouting/pom.xml
+\./apps/openstackswitching/pom.xml
+\./apps/vrouter/pom.xml
+
+\./protocols/ospf/
+\./protocols/snmp/
\ No newline at end of file