jar=$1 propertiesFile=`tar -tvf $jar | grep pom.properties | awk ' { print $9 } '` properties=`tar -xf $jar -O $propertiesFile` groupId=`echo "$properties" | grep groupId | awk -F'=' ' { print $2 }'` artifactId=`echo "$properties" | grep artifactId | awk -F'=' ' { print $2 }'` jar=$artifactId.jar mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get \ -Dartifact="$groupId:$artifactId:LATEST" \ -Dpackaging=jar \ -Ddest=$jar propertiesFile=`tar -tvf $jar | grep pom.properties | awk ' { print $9 } '` properties=`tar -xf $jar -O $propertiesFile` version=`echo "$properties" | grep version | awk -F'=' ' { print $2 }'` mv "$jar" "$artifactId-$version.jar"