# HG changeset patch # User Kostis Kyzirakos # Date 1366288966 -10800 # Node ID 8495c0c9b5975b0fd5eac53b4df0cc891c805c75 # Parent 61bc2e9bf304c22a23f9701bcea5d11c5cc43c92 Strabon build fails due to the recent dissapearence of Aduna's maven repository diff -r 61bc2e9bf304 -r 8495c0c9b597 pom.xml --- a/pom.xml Wed Apr 17 18:56:04 2013 +0300 +++ b/pom.xml Thu Apr 18 15:42:46 2013 +0300 @@ -840,7 +840,6 @@ - true @@ -875,6 +873,7 @@ Strabon - maven repository - snapshots http://maven.strabon.di.uoa.gr/content/repositories/snapshots + true diff -r 61bc2e9bf304 -r 8495c0c9b597 scripts/workaround/deploy-local-repo.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/workaround/deploy-local-repo.sh Thu Apr 18 15:42:46 2013 +0300 @@ -0,0 +1,84 @@ +#!/bin/bash +# check your ~/.m2/settings.xml for the correct values +DEPLOY_REPO_ID="strabon.testing" +DEPLOY_REPO_URL="http://maven.strabon.di.uoa.gr/content/repositories/testing/" +TEMP_DIR="/tmp/deploy-local-repo-$$" + +mkdir ${TEMP_DIR} +if [[ ! -d "${TEMP_DIR}" ]] ; then + echo "Could not create temporary directory." + echo "Aborting..." + exit +fi + + +for d in `find ${HOME}/.m2/repository -type d` ; +do + #for each directory + cd ${d} + children=`find . -type d|wc -l` + if [[ "${children}" -ne "1" ]] ; then + # if the directory has more subdirectories, move one + continue; + fi + + countPoms=`ls -1 *.pom 2>/dev/null|wc -l` + countJars=`ls -1 *.pom 2>/dev/null|wc -l` + + if [[ "${countPoms}" -gt "1" ]] && [[ "${countJars}" -gt "1" ]] ; then + echo "Found ${countPoms} poms and ${countJars} jars in directory '${d}'." + echo "Aborting..." + exit; + elif [[ "${countPoms}" -eq "0" ]] ; then + echo "No .pom file found in directory '${d}'." + echo "Aborting..." + exit; + fi + + pomFile=`ls -1 *.pom 2>/dev/null` + jarFile=`ls -1 *.jar 2>/dev/null` + cp ${pomFile} ${TEMP_DIR}/${pomFile} 2>/dev/null + cp ${jarFile} ${TEMP_DIR}/${jarFile} 2>/dev/null + + + if [[ "${countPoms}" -eq "1" ]] && [[ "${countJars}" -eq "1" ]] ; then + # deploy the local jar file to the remote repo + mvn deploy:deploy-file \ + -DrepositoryId=${DEPLOY_REPO_ID} \ + -Durl=${DEPLOY_REPO_URL} \ + -DpomFile=${TEMP_DIR}/${pomFile} \ + -Dfile=${TEMP_DIR}/${jarFile}; + elif [[ "${countPoms}" -eq "1" ]] && [[ "${countJars}" -eq "0" ]] ; then + # deploy the local pom file to the remote repo + mvn deploy:deploy-file \ + -DrepositoryId=${DEPLOY_REPO_ID} \ + -Durl=${DEPLOY_REPO_URL} \ + -DpomFile=${TEMP_DIR}/${pomFile} \ + -Dfile=${TEMP_DIR}/${pomFile}; + else + echo "Found ${countPoms} poms and ${countJars} jars in directory '${d}'." + echo "What should I do?" + echo "Aborting..." + exit; + fi + + pomFile=`ls -1 *.pom` + jarFile=`ls -1 *.jar` + + cp ${pomFile} ${TEMP_DIR}/${pomFile} + cp ${jarFile} ${TEMP_DIR}/${jarFile} + + # deploy the local file to the remote repo + mvn deploy:deploy-file \ + -DrepositoryId=${DEPLOY_REPO_ID} \ + -Durl=${DEPLOY_REPO_URL} \ + -DpomFile=${TEMP_DIR}/${pomFile} \ + -Dfile=${TEMP_DIR}/${jarFile}; + + # grooming + rm ${TEMP_DIR}/* +done + + +# grooming +rm -rf ${TEMP_DIR}