+ PROJECT_=""
+ NAME=$(echo "${REACTOR_INFO}" | awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }')
+fi
+
+
+# determine ARTIFACT_ID for project mailing list
+ARTIFACT_ID=$(awk -F: '/\[ERROR\].*mvn <goals> -rf :/ { print $2}' $CONSOLE_LOG)
+
+# determine project mailing list using xpaths
+# if project.groupId:
+# project.groupId is set and is not inherited
+# else if project.parent.groupId:
+# project.groupId is not set but IS inherited from project.parent.groupId
+# else
+# exclude project mailing list
+grouplist=()
+while IFS="" read -r p; do
+ GROUP=$(xmlstarlet sel\
+ -N "x=http://maven.apache.org/POM/4.0.0"\
+ -t -m "/x:project[x:artifactId='$ARTIFACT_ID']"\
+ --if "/x:project/x:groupId"\
+ -v "/x:project/x:groupId"\
+ --elif "/x:project/x:parent/x:groupId"\
+ -v "/x:project/x:parent/x:groupId"\
+ --else -o ""\
+ "$p" 2>/dev/null)
+ if [ ! -z "${GROUP}" ]; then
+ grouplist+=($(echo "${GROUP}" | awk -F'.' '{ print $3 }'))
+ fi
+done < <(find . -name "pom.xml")
+
+if [ "${#grouplist[@]}" -eq 1 ]; then
+ PROJECT="${grouplist[0]}"
+else
+ GROUPLIST="NOTE: The artifactId: $ARTIFACT_ID matches multiple groups: ${grouplist[*]}"