Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Labels:None
-
Number of attachments :
Description
I provide a new feature which get all enabled phases from the current pom.xml. I don't read the parent pom or settings.xml because it's difficult to know which parent pom is used, and the current configuration (profile activated, ...). And then it's a small tool, my goal was not corrupting the performance of the bash
#!/bin/bash
_m2_make_goals()
{
plugin=$1
mojos=$2
for mojo in $mojos
do
export goals="$goals $plugin:$mojo"
done
}
_m2_add_phases()
{
for phase in `grep -i '<phase>' pom.xml | sed 's/<phase>\(.*\)<\/phase>/\1/i'`
do
export goals="$goals $phase"
done
}
_m2_complete()
{
local cur goals
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
if [ -f pom.xml ]; then
goals='clean compile test install package deploy site help:effective-pom dependency:tree'
goals=$goals _m2_make_goals "eclipse" "eclipse"
goals=$goals _m2_add_phases
fi
COMPREPLY=($(compgen -W "${goals}" ${cur} | sed 's/\\\\//g') )
}
complete -F _m2_complete -o filenames mvn
how does this differ from MNG-3928 ?