Skip to content

Instantly share code, notes, and snippets.

@llbit
Created March 10, 2015 17:12
Show Gist options
  • Save llbit/3fb2bf9d4f893d8ace11 to your computer and use it in GitHub Desktop.
Save llbit/3fb2bf9d4f893d8ace11 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -lt "1" ]; then
echo "This script copies a maven artifact to a local directory"
echo "Usage: mvnget artifactID [dest-dir]"
echo " artifactID is <group:project:version>"
exit 1
fi
if [ $# -gt "2" ]; then
echo "Too many arguments!"
exit 1
fi
DEST="${2-$PWD}"
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy \
-Dartifact="$1" \
-DoutputDirectory="$DEST" \
-Dmdep.useBaseVersion=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment