From f67bc2d8c605101878f20561cc5dc0b2fc362d6f Mon Sep 17 00:00:00 2001 From: Mitja Vardjan Date: Fri, 7 Oct 2016 00:58:20 +0200 Subject: [PATCH 1/2] bugfix/workaround: more reliable profiles reading id of a profile (the element within ) can be specified in any line, it does not have to be specified in the first line --- bash_completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion.bash b/bash_completion.bash index 34f5906..4a3dcb0 100755 --- a/bash_completion.bash +++ b/bash_completion.bash @@ -196,7 +196,7 @@ _mvn() local profiles="${profile_settings}|" for item in ${POM_HIERARCHY[*]} do - local profile_pom=`[ -e $item ] && grep -e "" -A 1 $item | grep -e ".*" | sed 's/.*//' | sed 's/<\/id>.*//g' | tr '\n' '|' ` + local profile_pom=`[ -e $item ] && grep -e "" -A 1000 $item | grep --before-context=1000 '' | grep -e ".*" | sed 's/.*//' | sed 's/<\/id>.*//g' | tr '\n' '|' ` local profiles="${profiles}|${profile_pom}" done From 7c0d5d84487bb49a7536e80f4c1234eccf4fb889 Mon Sep 17 00:00:00 2001 From: Mitja Vardjan Date: Fri, 7 Oct 2016 01:02:27 +0200 Subject: [PATCH 2/2] pom files from modules are included too --- bash_completion.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bash_completion.bash b/bash_completion.bash index 4a3dcb0..0a9f838 100755 --- a/bash_completion.bash +++ b/bash_completion.bash @@ -110,6 +110,8 @@ __pom_hierarchy() fi POM_HIERARCHY+=("$pom") done + # Include also any pom from modules + for pom in $(find -mindepth 2 -name pom.xml); do POM_HIERARCHY+=("$pom"); done } _mvn()