Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
a5e706d7
Unverified
Commit
a5e706d7
authored
Oct 09, 2020
by
James Zhang
Committed by
GitHub
Oct 09, 2020
Browse files
mvn: list modules (directories with pom.xml) (#8478)
Co-authored-by:
zhangjinyan1
<
zhangjinyan1@guazi.com
>
parent
e93a2dca
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/mvn/mvn.plugin.zsh
View file @
a5e706d7
...
@@ -73,7 +73,7 @@ alias mvn-updates='mvn versions:display-dependency-updates'
...
@@ -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 {
...
@@ -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
...
@@ -271,8 +274,8 @@ function listMavenCompletions {
...
@@ -271,8 +274,8 @@ function listMavenCompletions {
stage:copy
stage:copy
# toolchain
# toolchain
toolchain:toolchain
toolchain:toolchain
#liberty
#liberty
liberty:clean-server liberty:compile-jsp liberty:configure-arquillian liberty:create-server liberty:debug liberty:debug-server liberty:deploy liberty:dev liberty:display-url liberty:dump-server liberty:install-apps liberty:install-feature liberty:install-server liberty:java-dump-server liberty:package-server liberty:run liberty:run-server liberty:server-status liberty:start liberty:start-server liberty:status liberty:stop liberty:stop-server liberty:test-start-server liberty:test-stop-server liberty:undeploy liberty:uninstall-feature
liberty:clean-server liberty:compile-jsp liberty:configure-arquillian liberty:create-server liberty:debug liberty:debug-server liberty:deploy liberty:dev liberty:display-url liberty:dump-server liberty:install-apps liberty:install-feature liberty:install-server liberty:java-dump-server liberty:package-server liberty:run liberty:run-server liberty:server-status liberty:start liberty:start-server liberty:status liberty:stop liberty:stop-server liberty:test-start-server liberty:test-stop-server liberty:undeploy liberty:uninstall-feature
# options
# options
"-Dmaven.test.skip=true"
-DskipTests
-DskipITs
-Dmaven
.surefire.debug
-DenableCiProfile
"-Dpmd.skip=true"
"-Dcheckstyle.skip=true"
"-Dtycho.mode=maven"
"-Dmaven.test.failure.ignore=true"
"-DgroupId="
"-DartifactId="
"-Dversion="
"-Dpackaging=jar"
"-Dfile="
"-Dmaven.test.skip=true"
-DskipTests
-DskipITs
-Dmaven
.surefire.debug
-DenableCiProfile
"-Dpmd.skip=true"
"-Dcheckstyle.skip=true"
"-Dtycho.mode=maven"
"-Dmaven.test.failure.ignore=true"
"-DgroupId="
"-DartifactId="
"-Dversion="
"-Dpackaging=jar"
"-Dfile="
...
@@ -323,6 +326,7 @@ function listMavenCompletions {
...
@@ -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
)
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment