summaryrefslogtreecommitdiffstats
path: root/jvpp/common.sh
blob: 85d86b51ddb81ccf4c2b9e827539bc81df1cb7d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

# Installs jvpp jar to local maven repository.
#
# $1 - jvpp jar file path
# $1 - target artifact version
#
function install_jvpp_jar {
  jarfile=$1
  version=$2

  # Filename (includes version suffix), e.g. jvpp-core-19.08
  basefile=$(basename -s .jar "$jarfile")

  # Remove version suffix
  artifactId=$(echo "$basefile" | rev | cut -d '-' -f 2- | rev)

  mvn install:install-file \
    -Dfile=$jarfile \
    -DgroupId=io.fd.jvpp \
    -DartifactId=$artifactId \
    -Dversion=$version \
    -Dpackaging=jar
}