#!/bin/bash
warfile=$1
function strip_version_numbers() {
# converte foo/bar-1.2.3.jar in foo/bar.jar
ruby -pe 'gsub($1, "") if $_ =~ /^.*(-[0-9.]+)(-bin)?.jar/'
}
# check there are no duplicates entries in war
if jar tf $warfile | strip_version_numbers | sort | uniq -c | sort -nr | head | grep '^ [2-9]'
then
echo "duplicate entries found"
exit 1
fi
Nessun commento:
Posta un commento