This is a modification of the one in the wiki that will copy them to
a corporate repository, not your local repo. This way your hole team
can use them.
=============
#!/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=beetroot.repo \
-Durl=sftp://www.beetroot.net/srv/maven/repo/www/
fi
done
exit
==============
On 07/03/2007, at 9:38 AM, Ryan Daum wrote:
Has anybody put together a script for installing the restlet poms +
jars into a maven repository? Is there a plan to get the poms +
jars released onto ibiblio?
Ryan
On 1/16/07, Jerome Louvel <[EMAIL PROTECTED]> wrote:
Hi all,
As Maven support appears to be important for many of you, we are now
automatically generating the POM files for each module JAR that we
provide.
The dependencies on third-party are correctly declared too.
The files are available under the "lib/poms" directory in the
distribution.
Please test and let me know if that fully works. I have also
released a new
snapshot to facilitate testing.
Best regards,
Jerome Louvel
--
http://www.restlet.org
--
Ryan Daum
[EMAIL PROTECTED]
Senior Developer, Toronto
647.724.5232 x 2073