Hi Marc, On Jan 19, 2010, at 3:13 PM, Marc Limotte wrote:
> I need to use restlet in a project which is managed by Maven2. I'm > not too familiar with Maven, but I think I need a POM file for > restlet, and I don't see one in the maven central repository. Is > there a repo available with restlet (2.0-r6) in it? > > Alternatively, I thought I could add it to my local repo. I found > this script (below) in the restlet mailing list archives, but it's > quite old and seems to depend on POM files coming with the restlet > distribution (under lib/poms), and there is no such directory in the > dist that I downloaded. > > What's the easiest way to do this? http://www.restlet.org/downloads/maven Rhett > > Marc > > > -----Message d'origine----- > > De : news [EMAIL PROTECTED] De la part de Vincent > > Envoyé : jeudi 18 janvier 2007 20:36 > > À : [email protected] > > Objet : Script to install a Restlet distribution into a > > maven2 repository > > > > Hi all, > > > > I use this bash script to upgrade my local maven2 repository > > each time a new version of Restlet comes up. > > Some of you might find it useful. > > > > -Vincent. > > > > #!/bin/bash > > # > > # This script installs a Restlet disrtribution into a local > > (filesystem) > > # maven2 repository. > > # > > # Usage: restlet2mvn.bsh <path to Restlet distribution > > > <path to local maven > > repository> > > # > > > > if [ $# -le 1 ]; then > > echo "Usage: restlet2mvn.bsh <path to Restlet distribution > > > <path to local > > maven repository>" > > exit 1; > > fi > > RESTLET_DIST=$1 > > MAVEN_REPOSITORY=$2 > > MVN=mvn > > > > if [ ! -e $RESTLET_DIST ] > > then > > echo "Restlet distribution not found: $RESTLET_DIST" > > exit 1; > > fi > > > > if [ ! -e $MVN_REPO ] > > then > > echo "Maven repository not found: $MVN_REPO" > > exit 1; > > fi > > > > LIB_DIR=$RESTLET_DIST/lib > > POMS_DIR=$RESTLET_DIST/lib/poms > > > > poms=`ls $POMS_DIR/*.pom` > > > > > > for pom in $poms > > do > > # restlet/lib/poms/foo.pom -> restlet/lib/foo.jar > > jar=`echo $pom | sed s/.pom$/.jar/g | sed s/poms\\\///g` > > if [ -e $jar ] > > then > > # Extract the group, artifact id, and version number from the > POM: > > # We assume that the first <groupId>, <artifactId>, > > <version> tags found in > > the pom > > # contain the module's group id, artifact id, and version #. > > # This will break if the pom contains commented out tags: > > # <groupId>foo<.groupId> > > # <!-- <artifactId>bar</artifactId> --> > > # <artifactId>bar</artifactId> > > # <versio>1.0</version> > > group=` grep --regexp '<groupId>.*</groupId>' > > --max-count=1 $pom | sed > > 's/[[:space:]]*<[^><]*>[[:space:]]*//g' ` > > artifact=` grep --regexp '<artifactId>.*</artifactId>' > > --max-count=1 $pom | > > sed 's/[[:space:]]*<[^><]*>[[:space:]]*//g' ` > > version=` grep --regexp '<version>.*</version>' > > --max-count=1 $pom | sed > > 's/[[:space:]]*<[^><]*>[[:space:]]*//g' ` > > # Now deploy the module > > $MVN deploy:deploy-file -DgroupId=$group \ > > -DgeneratePom=false \ > > -DpomFile=$pom \ > > -DartifactId=$artifact \ > > -Dversion=$version \ > > -Dpackaging=jar \ > > -Dfile=$jar \ > > -DrepositoryId=local-repository \ > > -Durl=file://$MAVEN_REPOSITORY > > > > fi > > done > > > > exit > > > > > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2440449

