mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-25 07:10:08 +00:00
mvn: list modules (directories with pom.xml) (#8478)
Co-authored-by: zhangjinyan1 <zhangjinyan1@guazi.com>
This commit is contained in:
parent
e93a2dca0e
commit
a5e706d749
1 changed files with 7 additions and 3 deletions
|
@ -73,7 +73,7 @@ alias mvn-updates='mvn versions:display-dependency-updates'
|
||||||
|
|
||||||
function listMavenCompletions {
|
function listMavenCompletions {
|
||||||
local file new_file
|
local file new_file
|
||||||
local -a profiles POM_FILES
|
local -a profiles POM_FILES modules
|
||||||
|
|
||||||
# Root POM
|
# Root POM
|
||||||
POM_FILES=(~/.m2/settings.xml)
|
POM_FILES=(~/.m2/settings.xml)
|
||||||
|
@ -109,6 +109,9 @@ function listMavenCompletions {
|
||||||
profiles+=($(sed 's/<!--.*-->//' "$file" | sed '/<!--/,/-->/d' | grep -e "<profile>" -A 1 | grep -e "<id>.*</id>" | sed 's?.*<id>\(.*\)<\/id>.*?-P\1?'))
|
profiles+=($(sed 's/<!--.*-->//' "$file" | sed '/<!--/,/-->/d' | grep -e "<profile>" -A 1 | grep -e "<id>.*</id>" | sed 's?.*<id>\(.*\)<\/id>.*?-P\1?'))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# List modules
|
||||||
|
modules=($(find **/pom.xml -type f | grep -v '/target/classes/META-INF/' | grep '/pom.xml' |sed 's|\(.*\)/pom\.xml|\1|'))
|
||||||
|
|
||||||
reply=(
|
reply=(
|
||||||
# common lifecycle
|
# common lifecycle
|
||||||
clean initialize process-resources compile process-test-resources test-compile test package verify install deploy site
|
clean initialize process-resources compile process-test-resources test-compile test package verify install deploy site
|
||||||
|
@ -323,6 +326,7 @@ function listMavenCompletions {
|
||||||
-Dit.test=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi)
|
-Dit.test=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi)
|
||||||
|
|
||||||
$profiles
|
$profiles
|
||||||
|
$modules
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue