Skip the directory if it does not have a POM file
Change-Id: I78e2315b834b5719b6968a5667e6c865b8bfb75a
diff --git a/tools/dev/bin/onos-build-selective b/tools/dev/bin/onos-build-selective
index ac2dec8..351c53a 100755
--- a/tools/dev/bin/onos-build-selective
+++ b/tools/dev/bin/onos-build-selective
@@ -15,9 +15,11 @@
# Ascertain artifact IDs of the projects to be rebuilt
modulesERE=""
for pd in ${projects//,/ }; do
- artifactId=$(grep -E "^ <artifactId>.*</artifactId>$" ${pd}/pom.xml | \
- sed 's/.[^>]*>//;s/<.*//')
- modulesERE="$modulesERE|$artifactId"
+ if [ -f ${pd}/pom.xml ]; then
+ artifactId=$(grep -E "^ <artifactId>.*</artifactId>$" ${pd}/pom.xml | \
+ sed 's/.[^>]*>//;s/<.*//')
+ modulesERE="$modulesERE|$artifactId"
+ fi
done
modulesERE=${modulesERE#|*}