#!/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 " 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