A script to add 3rd party artifacts to your maven repository
By warren on Apr 22, 2008
I find the maven command line very obtuse and have trouble remembering the right incantation to add 3rd party jars to a local repository.
Here is a small bash script which might be useful to others. You will need to edit this for your environment.
# Add 3rd party jars to maven in a batch
# Usage: madd groupid version jar1 jar2 ...
# Edit the mvn command as per your repo setup
if [ $# -lt 3 ]; then
echo Usage: $0 groupid version jar1 jar2...
for file in $\*
ARTIFACTID=`echo $file | sed -e 's/\\.jar//'`
mvn deploy:deploy-file -DgroupId=$GROUPID -DartifactId=$ARTIFACTID \\
-Dversion=$VERSION -Dpackaging=jar -Dfile=$file \\