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>
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
}
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
}