Use -o with grep to guarantee filename position
[releng/global-jjb.git] / shell / maven-fetch-metadata.sh
index 45f1a9b..3c9b78f 100644 (file)
@@ -13,7 +13,7 @@ echo "---> maven-fetch-metadata.sh"
 
 # Check for "-f" maven param, indicating a change in pom location.
 pom_path="pom.xml"
-file_path=$(echo "$MAVEN_PARAMS" | grep -E "\-f \S+" | awk '{ print $2 }')
+file_path=$(echo "$MAVEN_PARAMS" | grep -Eo "\-f \S+" | awk '{ print $2 }')
 if [ -n "$file_path" ]; then
     if [ -d "$file_path" ]; then
         pom_path="$file_path/pom.xml"