Created
June 9, 2014 23:32
-
-
Save ryantenney/f522cfaf38fa300d5c3a to your computer and use it in GitHub Desktop.
Download the latest version of a Jar from maven
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment