Fix artifactId and version of deployed jars 11/2411/6
authorMarek Gradzki <mgradzki@cisco.com>
Wed, 17 Aug 2016 05:21:15 +0000 (07:21 +0200)
committerC.J. Collier <cjcollier@linuxfoundation.org>
Wed, 17 Aug 2016 17:05:33 +0000 (10:05 -0700)
Jar name can consist of more than two groups
separated by a hyphen. Last group should be
treated as a version, rest as artifact name.

Examples:

jvpp-registry-16.09.jar
jvpp-16.09.jar

Add example jar names to source to ease comprehension

Change-Id: Ica0b490c4213224abc70774aa41c60e62f0360f0
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: C.J. Collier <cjcollier@linuxfoundation.org>
jjb/scripts/maven_push_functions.sh
jjb/vpp/include-raw-vpp-maven-push.sh

index 45428e2..6849f31 100644 (file)
@@ -50,9 +50,13 @@ function push_jar ()
     repoId="${BASEREPOID}snapshot"
     url="${BASEURL}snapshot"
 
+    # examples:
+    # * jvpp-registry-16.09.jar
+    # * jvpp-16.09.jar
+
     basefile=$(basename -s .jar "$jarfile")
-    artifactId=$(echo "$basefile" | cut -f 1 -d '-')
-    version=$(echo "$basefile" | cut -f 2 -d '-')
+    artifactId=$(echo "$basefile" | rev | cut -d '-' -f 2-  | rev)
+    version=$(echo "$basefile" | rev | cut -d '-' -f 1  | rev)
 
     push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar
 }
index 0e9c334..c26e5d3 100644 (file)
@@ -47,8 +47,8 @@ function push_jar ()
     url="${BASEURL}snapshot"
 
     basefile=$(basename -s .jar "$jarfile")
-    artifactId=$(echo "$basefile" | cut -f 1 -d '-')
-    version=$(echo "$basefile" | cut -f 2 -d '-')
+    artifactId=$(echo "$basefile" | rev | cut -d '-' -f 2-  | rev)
+    version=$(echo "$basefile" | rev | cut -d '-' -f 1  | rev)
 
     push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar
 }