summaryrefslogtreecommitdiffstats
path: root/jvpp/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jvpp/common.sh')
-rwxr-xr-xjvpp/common.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/jvpp/common.sh b/jvpp/common.sh
new file mode 100755
index 000000000..456270635
--- /dev/null
+++ b/jvpp/common.sh
@@ -0,0 +1,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-18.01
+ 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.vpp \
+ -DartifactId=$artifactId \
+ -Dversion=$version \
+ -Dpackaging=jar
+}