-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmaven.sh
More file actions
63 lines (55 loc) 路 1.54 KB
/
Copy pathmaven.sh
File metadata and controls
63 lines (55 loc) 路 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
export MAVEN_OPTS="-Xmx1536m"
# license-maven-plugin
lic() {
local quiet=
test "$1" = "-q" && quiet=true
test -f pom.xml || {
test -z "$quiet" && echo "[ERROR] Not a Maven project."
return 1
}
local licName=$(grep 'license\.licenseName' pom.xml | sed -e 's/[^>]*>//' -e 's/<.*//')
test "$licName" -a "$licName" != "N/A" || {
test -z "$quiet" && echo "[ERROR] Unsupported license: $licName"
return 2
}
mvn license:update-file-header license:update-project-license
}
# dependency-maven-plugin
alias anal='mvn dependency:analyze | grep WARNING'
# tidy-maven-plugin
alias tdy='mvn tidy:pom'
# build it!
alias b='lic -q; mvn clean install'
alias bs='mvn -Denforcer.skip -DskipTests -Dinvoker.skip clean install'
alias bse='mvn -Denforcer.skip clean install'
alias bst='mvn -DskipTests -Dinvoker.skip clean install'
# Preserve color output when piping -- the opposite of --batch-mode.
alias mvc='mvn -Dstyle.color=always'
mvnhelp() {
: << 'DOC'
Show detailed help on a specific Maven goal.
Usage example:
mvnhelp versions:display-dependency-updates
DOC
plugin=${1%:*}
goal=${1#*:}
mvn help:describe -Dplugin="$plugin" -Dgoal="$goal" -Ddetail
}
mvnget() {
while [ $# -gt 0 ]
do
gav=$1
shift
# Note: We cannot use dependency:copy because it
# does not support the -DremoteRepositories option.
mvn dependency:get \
-Dartifact="$gav" \
-DremoteRepositories=https://maven.scijava.org/content/groups/public
g=${gav%%:*}
g=${g//./\/}
av=${gav#*:}
p=${av//:/\/}
n=${av//:/-}.jar
cp ~/.m2/repository/"$g"/"$p"/"$n" .
done
}