The "-f" maven param can specify both a directory, in which case it
will look for "pom.xml" in the directory, or a specific file. The
original version of this search was only compatible with directories
that contain a pom.xml file.
Change-Id: I81ab161f3156fc2159a4b7ca9ca084a0f82da795
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
--- /dev/null
+---
+fixes:
+ - |
+ Adapt maven path search for files and dirs. The "-f" maven param can
+ specify both a directory, in which case it will look for "pom.xml" in the
+ directory, or a specific file. The original version of this search was only
+ compatible with directories that contain a pom.xml file.
pom_path="pom.xml"
file_path=$(echo $MAVEN_PARAMS | grep -E "\-f \S+" | awk '{ print $2 }')
if [ ! -z $file_path ]; then
- pom_path="$file_path/pom.xml"
+ if [ -d $file_path ]; then
+ pom_path="$file_path/pom.xml"
+ else
+ pom_path="$file_path"
+ fi
fi
# Ensure we fail the job if any steps fail.