-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathmvn_cmd
executable file
·72 lines (68 loc) · 1.71 KB
/
mvn_cmd
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
64
65
66
67
68
69
70
71
72
#!/bin/bash
MVN=mvn
function run_mvn() {
PROFILES=$1
PHASES=$2
SWITCH=$3
if [ -z "$PROFILES" ]; then
if [ -z "${SWITCH}" ]; then
${MVN} -B -U ${PHASES}
else
${MVN} -B -U ${PHASES} ${SWITCH}
fi
else
if [ -z "${SWITCH}" ]; then
${MVN} -B -U -P${PROFILES} ${PHASES}
else
${MVN} -B -U -P${PROFILES} ${PHASES} ${SWITCH}
fi
fi
}
CMD=$1
ARG=$2
case "$CMD" in
clean)
run_mvn "integration,benchmark,profile,fuzz,distribution" "clean"
;;
javadoc)
run_mvn "" "javadoc:javadoc"
;;
package)
run_mvn "distribution" "package"
;;
verify)
run_mvn "distribution" "verify"
;;
install)
run_mvn "distribution" "install"
;;
versions-set)
if [ -z "${ARG}" ]; then
echo "USAGE: `basename $0` versions-set <version>"
exit 1
fi
run_mvn "distribution" "versions:set" "-DnewVersion=${ARG} -DgenerateBackupPoms=false"
;;
versions-display-dependency)
run_mvn "integration,benchmark,profile,fuzz,distribution" "versions:display-dependency-updates"
;;
versions-display-plugin)
run_mvn "integration,benchmark,profile,fuzz,distribution" "versions:display-plugin-updates"
;;
deploy)
if [ -z "${ARG}" ]; then
echo "USAGE: `basename $0` deploy <repo-directory>"
exit 1
fi
run_mvn "" clean
run_mvn "" "deploy" "-DaltDeploymentRepository=snapshot::default::file://${ARG}"
;;
bundle-create)
run_mvn "distribution" "repository:bundle-create" "-Dsign=true"
;;
*)
if [ -n "$1" ]; then
echo "Invalid command"
fi
echo "USAGE: `basename $0` clean|javadoc|package|verify|install|versions-set|versions-display-dependency|versions-display-plugin|deploy|bundle-create"
esac