summaryrefslogtreecommitdiffstats
path: root/jvpp/common.sh
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-12-19 10:19:43 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-12-19 10:59:42 +0100
commit5b59e1bd3009a2d9a37c5df86bf34b3d3673f0ea (patch)
tree1dcb124e115171eedb037eadec50f899cf18a1bf /jvpp/common.sh
parent4840c9fc6ab956d6210ac33d8e9c5b1abbc4172e (diff)
Scripts for installing jvpp jars to local mvn repo
By default hc2vpp build downloads latest jvpp packages from nexus.fd.io. They might not be compatible with installed vpp (e.g. in case of non-backward compatible vpp api changes). In order to prevent API mismatch, it is required to use jvpp version corresponding to the vpp installed. The patch includes scripts that can be used before building hc2vpp to install jvpp jars from vpp build dir or vpp-api-java package. Change-Id: I9aa0dc37921e022e5644c54238d3d579f6eb5ba8 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
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
+}