Copy files also to m2 repo

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@399158 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Carlos Sanchez Gonzalez 2006-05-03 05:58:15 +00:00
parent 7d5d3668fe
commit b737bf3831
1 changed files with 33 additions and 3 deletions

View File

@ -19,6 +19,7 @@ echo "Script directory is: ${SCRIPTDIR}"
# repo dir relative to WORKDIR # repo dir relative to WORKDIR
REPODIR=$HOME/repository-staging/to-ibiblio/maven REPODIR=$HOME/repository-staging/to-ibiblio/maven
REPO2DIR=$HOME/repository-staging/to-ibiblio/maven2
rm -rf $WORKDIR > /dev/null 2>&1 rm -rf $WORKDIR > /dev/null 2>&1
@ -102,6 +103,15 @@ BUNDLE=tmp.jar
version=`echo ${version} | sed -e 's/ *$//'` version=`echo ${version} | sed -e 's/ *$//'`
artifactId=`echo ${artifactId} | sed -e 's/ *$//'` artifactId=`echo ${artifactId} | sed -e 's/ *$//'`
groupId=`echo ${groupId} | sed -e 's/ *$//'` groupId=`echo ${groupId} | sed -e 's/ *$//'`
groupDir=`echo ${groupId} | sed -e 's/\./\//g'`
maven2=`cat ${POM} | tr '\n' ' ' | sed -e 's#^.*<modelVersion>##;s#</modelVersion>.*$##'`
echo
if [ ! -z ${maven2} ]
then
echo " ========= MAVEN 2 ========= "
fi
echo echo
echo " version: [${version}]" echo " version: [${version}]"
@ -109,7 +119,7 @@ BUNDLE=tmp.jar
echo "artifactId: [${artifactId}]" echo "artifactId: [${artifactId}]"
echo echo
if [ -d $REPODIR/${groupId} ] if [ -d $REPO2DIR/${groupDir} ]
then then
echo "The group already exists" echo "The group already exists"
else else
@ -134,21 +144,35 @@ BUNDLE=tmp.jar
cp ${POM} ${artifactId}-${version}.pom cp ${POM} ${artifactId}-${version}.pom
m2dir=$REPO2DIR/${groupDir}/${artifactId}/${version}
mkdir -p ${m2dir}
mkdir -p $REPODIR/${groupId}/poms mkdir -p $REPODIR/${groupId}/poms
cp -i ${artifactId}-${version}.pom $REPODIR/${groupId}/poms cp -i ${artifactId}-${version}.pom $REPODIR/${groupId}/poms
if [ ! -z ${maven2} ]
then
cp -i ${artifactId}-${version}.pom ${m2dir}
md5sum ${m2dir}/${artifactId}-${version}.pom > ${m2dir}/${artifactId}-${version}.pom.md5
sha1sum ${m2dir}/${artifactId}-${version}.pom > ${m2dir}/${artifactId}-${version}.pom.sha1
fi
artifactType=`echo ${artifactId} | sed -e 's/maven-.*-plugin//'` artifactType=`echo ${artifactId} | sed -e 's/maven-.*-plugin//'`
if [ -z ${artifactType} ] if [ -z ${artifactType} ]
then then
echo "Deploying Plugin ..." echo "Deploying Plugin ..."
mkdir -p $REPODIR/${groupId}/plugins mkdir -p $REPODIR/${groupId}/plugins
cp -i ${artifactId}-${version}.jar $REPODIR/${groupId}/plugins cp -i ${artifactId}-${version}.jar $REPODIR/${groupId}/plugins
else else
echo "Deploying JAR ..." echo "Deploying JAR ..."
mkdir -p $REPODIR/${groupId}/jars mkdir -p $REPODIR/${groupId}/jars
cp -i ${artifactId}-${version}.jar $REPODIR/${groupId}/jars cp -i ${artifactId}-${version}.jar $REPODIR/${groupId}/jars
cp -i ${artifactId}-${version}.jar ${m2dir}
if [ -f ${m2dir}/${artifactId}-${version}.jar ]
md5sum ${m2dir}/${artifactId}-${version}.jar > ${m2dir}/${artifactId}-${version}.jar.md5
sha1sum ${m2dir}/${artifactId}-${version}.jar > ${m2dir}/${artifactId}-${version}.jar.sha1
fi
fi fi
if [ -f ${artifactId}-${version}-sources.jar ] if [ -f ${artifactId}-${version}-sources.jar ]
@ -156,6 +180,9 @@ BUNDLE=tmp.jar
echo "Deploying Java sources ..." echo "Deploying Java sources ..."
mkdir -p $REPODIR/${groupId}/java-sources mkdir -p $REPODIR/${groupId}/java-sources
cp -i ${artifactId}-${version}-sources.jar $REPODIR/${groupId}/java-sources cp -i ${artifactId}-${version}-sources.jar $REPODIR/${groupId}/java-sources
cp -i ${artifactId}-${version}-sources.jar ${m2dir}
md5sum ${m2dir}/${artifactId}-${version}-sources.jar > ${m2dir}/${artifactId}-${version}-sources.jar.md5
sha1sum ${m2dir}/${artifactId}-${version}-sources.jar > ${m2dir}/${artifactId}-${version}-sources.jar.sha1
else else
echo "No Java sources available in upload bundle, skipping ..." echo "No Java sources available in upload bundle, skipping ..."
fi fi
@ -165,6 +192,9 @@ BUNDLE=tmp.jar
echo "Deploying Javadocs ..." echo "Deploying Javadocs ..."
mkdir -p $REPODIR/${groupId}/javadoc mkdir -p $REPODIR/${groupId}/javadoc
cp -i ${artifactId}-${version}-javadoc.jar $REPODIR/${groupId}/javadoc cp -i ${artifactId}-${version}-javadoc.jar $REPODIR/${groupId}/javadoc
cp -i ${artifactId}-${version}-javadoc.jar ${m2dir}
md5sum ${m2dir}/${artifactId}-${version}-javadoc.jar > ${m2dir}/${artifactId}-${version}-javadoc.jar.md5
sha1sum ${m2dir}/${artifactId}-${version}-javadoc.jar > ${m2dir}/${artifactId}-${version}-javadoc.jar.sha1
else else
echo "No Javadocs available in upload bundle, skipping ..." echo "No Javadocs available in upload bundle, skipping ..."
fi fi