File: mvn_cmd

package info (click to toggle)
ldaptive 2.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,192 kB
  • sloc: java: 68,618; xml: 3,223; sh: 338; makefile: 2
file content (94 lines) | stat: -rwxr-xr-x 2,241 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash

MVN=mvn

function run_mvn() {
  PROFILES=$1
  PHASES=$2
  SWITCH=$3
  if [ -z "$PROFILES" ]; then
    if [ -z "${SWITCH}" ]; then
      if [ -z "${JDK8}" ]; then
        ${MVN} -B -U ${PHASES}
      else
        ${MVN} -B -U -Pjdk8 ${PHASES}
      fi
    else
      if [ -z "${JDK8}" ]; then
        ${MVN} -B -U ${PHASES} ${SWITCH}
      else
        ${MVN} -B -U -Pjdk8 ${PHASES} ${SWITCH}
      fi
    fi
  else
    if [ -z "${SWITCH}" ]; then
      if [ -z "${JDK8}" ]; then
        ${MVN} -B -U -P${PROFILES} ${PHASES}
      else
        ${MVN} -B -U -P${PROFILES},jdk8 ${PHASES}
      fi
    else
      if [ -z "${JDK8}" ]; then
        ${MVN} -B -U -P${PROFILES} ${PHASES} ${SWITCH}
      else
        ${MVN} -B -U -P${PROFILES},jdk8 ${PHASES} ${SWITCH}
      fi
    fi
  fi
}

if [ "$1" = "--with-jdk8" ]; then
  JDK8="true"
  CMD=$2
  ARG=$3
else
  CMD=$1
  ARG=$2
fi

case "$CMD" in
  clean)
    run_mvn "integration,benchmark,profile,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,distribution" "versions:display-dependency-updates"
    ;;
  versions-display-plugin)
    run_mvn "integration,benchmark,profile,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` [--with-jdk8] clean|javadoc|package|verify|install|versions-set|versions-display-dependency|versions-display-plugin|deploy|bundle-create"
esac