Feeds:
Beiträge
Kommentare

Archive for the ‘Maven’ Category

Auf der Suche nach einer Möglichkeit, alle JARs eines Verzeichnisses in das lokale Maven Repository zu schieben, bin ich auf dieses Script gestoßen:
A script to add 3rd party artifacts to your maven repository.
Diese Version habe ich leicht abgeändert, quick and dirty:


#!/bin/bash
# Add 3rd party jars to maven in a batch
# Usage: add2maven groupid directory
#
# Edit the mvn command as per your repo setup

if [ $# -lt 2 ]; then
echo Usage: $0 groupid directory
exit 1
fi

GROUPID=$1
shift

find $1 -name "*.jar" | while read f;
do
if [ ! -d $f ]; then
FILENAME=`echo $f | sed -e 's/\.jar//' | sed -e 's/.*\///'`
ARTIFACTID=`echo $FILENAME | sed -re 's/[_|-]([0-9]\.).*//g'`
VERSION=`echo $FILENAME | sed -re 's/.*[a-z][-|_]//'`
if [ "$VERSION" == "$FILENAME" ]; then
VERSION="unknown"
fi
mvn install:install-file -DgroupId=$GROUPID -DartifactId=$ARTIFACTID -Dversion=$VERSION -Dpackaging=jar -Dfile=$f
fi
done

Read Full Post »