Strabon

changeset 1049:c3bf7385caf7

Merge.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Fri Apr 19 11:30:01 2013 +0300 (2013-04-19)
parents cc1504a43458 9b34e404bcaf
children c71d43100552
files
line diff
     1.1 --- a/pom.xml	Fri Apr 19 11:28:52 2013 +0300
     1.2 +++ b/pom.xml	Fri Apr 19 11:30:01 2013 +0300
     1.3 @@ -875,6 +875,18 @@
     1.4  			<name>Strabon - maven repository - snapshots</name>
     1.5  			<url>http://maven.strabon.di.uoa.gr/content/repositories/snapshots</url>
     1.6  		</repository>
     1.7 +        <repository>
     1.8 +            <releases>
     1.9 +                <enabled>true</enabled>
    1.10 +            </releases>
    1.11 +            <snapshots>
    1.12 +                <enabled>false</enabled>
    1.13 +            </snapshots>
    1.14 +            <id>strabon.sesame</id>
    1.15 +            <name>Strabon - maven repository - sesame artifacts (temporary)</name>
    1.16 +            <url>http://maven.strabon.di.uoa.gr/content/repositories/strabon.sesame/</url>
    1.17 +        </repository>
    1.18 +		<!--
    1.19  		<repository>
    1.20  			<releases>
    1.21  				<enabled>true</enabled>
    1.22 @@ -897,6 +909,7 @@
    1.23  			<name>Aduna Open Source - Maven snapshots</name>
    1.24  			<url>http://repo.aduna-software.org/maven2/snapshots</url>
    1.25  		</repository>
    1.26 +		-->
    1.27  		<repository>
    1.28  			<snapshots>
    1.29  				<enabled>true</enabled>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/scripts/workaround/deploy-local-repo.sh	Fri Apr 19 11:30:01 2013 +0300
     2.3 @@ -0,0 +1,141 @@
     2.4 +#!/bin/bash
     2.5 +
     2.6 +#
     2.7 +# This Source Code Form is subject to the terms of the Mozilla Public
     2.8 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     2.9 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    2.10 +#
    2.11 +# Copyright (C) 2010, 2011, 2012, Pyravlos Team
    2.12 +#
    2.13 +# http://www.strabon.di.uoa.gr/
    2.14 +#
    2.15 +
    2.16 +#
    2.17 +# Script for deploying a local maven repository to a remote one
    2.18 +#
    2.19 +# Author: Kostis Kyzirakos <kk@di.uoa.gr>
    2.20 +#
    2.21 +
    2.22 +
    2.23 +# server id that maps on the <id> under <server> section of ~/.m2/settings.xml.
    2.24 +# In most cases, this parameter will be required for authentication.
    2.25 +DEPLOY_REPO_ID="strabon"
    2.26 +
    2.27 +# the url of the remote repository
    2.28 +DEPLOY_REPO_URL="http://maven.strabon.di.uoa.gr/content/repositories/strabon.sesame/"
    2.29 +
    2.30 +# temporary folder
    2.31 +TEMP_DIR="/tmp/deploy-local-repo-$$"
    2.32 +
    2.33 +# command name
    2.34 +CMD="$(basename ${0})"
    2.35 +
    2.36 +function help() {
    2.37 +        echo "Usage: ${CMD} [OPTIONS] [DIR]"
    2.38 +        echo
    2.39 +        echo "Deploy a local maven repository to a remote one"
    2.40 +        echo
    2.41 +        echo "  DIR     : resume the deployment of the local repository, starting from this directory"
    2.42 +        echo
    2.43 +        echo "OPTIONS can be any of the following (variable names and values are case sensitive)"
    2.44 +        echo "  --help           : Print this menu"
    2.45 +		echo ""
    2.46 +}
    2.47 +
    2.48 +if [[ ${#} -gt "0" ]] ; then
    2.49 +	ARRAY=(${@})
    2.50 +	ELEMENTS=${#ARRAY[@]}
    2.51 +	for (( i = 0; i < ${ELEMENTS}; i++ )); do
    2.52 +		if [[ "${ARRAY[${i}]}" = "--help" ]] || [[ "${ARRAY[${i}]}" = "-help" ]] || [[ "${ARRAY[${i}]}" = "help" ]]; then
    2.53 +			help
    2.54 +			exit 0
    2.55 +		fi
    2.56 +	done
    2.57 +fi
    2.58 +
    2.59 +mkdir ${TEMP_DIR}
    2.60 +if [[ ! -d "${TEMP_DIR}" ]] ; then
    2.61 +	echo "Could not create temporary directory."
    2.62 +	echo "Aborting..."
    2.63 +	exit
    2.64 +fi
    2.65 +
    2.66 +found=false;
    2.67 +for d in `find ${HOME}/.m2/repository -type d|sort` ;
    2.68 +do
    2.69 +	if [[ ! -z "$1" ]] && [[ "${found}" = "false" ]] && [[ "$d" != "$1" ]] ; then
    2.70 +		echo "Skipping ${d}"
    2.71 +		continue;
    2.72 +	fi
    2.73 +	# resuming
    2.74 +	found=true;
    2.75 +
    2.76 +	#for each directory
    2.77 +	cd ${d}
    2.78 +	children=`find . -type d|grep -v '^.$'|wc -l`
    2.79 +	if [[ "${children}" -ne "0" ]] ; then
    2.80 +		# if the directory has more subdirectories, move one
    2.81 +		continue;
    2.82 +	fi
    2.83 +
    2.84 +	countPoms=`ls -1 *.pom 2>/dev/null|wc -l`
    2.85 +	countJars=`ls -1 *.jar 2>/dev/null|wc -l`
    2.86 +
    2.87 +	if [[ "${countPoms}" -gt "1" ]] && [[ "${countJars}" -gt "1" ]] ; then
    2.88 +		echo "Found ${countPoms} poms and ${countJars} jars in directory '${d}'."
    2.89 +		echo "Aborting..."
    2.90 +		exit;
    2.91 +	elif [[ "${countPoms}" -eq "0" ]] ; then
    2.92 +		echo "No .pom file found in directory '${d}' (${children} children)."
    2.93 +		echo "Aborting..."
    2.94 +		exit;
    2.95 +	fi
    2.96 +
    2.97 +	if [[ "${countPoms}" -eq "1" ]] && [[ "${countJars}" -eq "1" ]] ; then
    2.98 +		pomFile=`ls -1 *.pom 2>/dev/null`
    2.99 +		jarFile=`ls -1 *.jar 2>/dev/null`
   2.100 +		cp ${pomFile} ${TEMP_DIR}/${pomFile} 2>/dev/null
   2.101 +		cp ${jarFile} ${TEMP_DIR}/${jarFile} 2>/dev/null
   2.102 +		# deploy the local jar file to the remote repo
   2.103 +		mvn deploy:deploy-file \
   2.104 +			-DrepositoryId=${DEPLOY_REPO_ID} \
   2.105 +			-Durl=${DEPLOY_REPO_URL} \
   2.106 +			-DpomFile=${TEMP_DIR}/${pomFile} \
   2.107 +			-Dfile=${TEMP_DIR}/${jarFile};
   2.108 +		if [[ "$?" -ne "0" ]] ; then echo "Error occured while processing directory '${d}' (temp dir is '${TEMP_DIR}')"; exit; fi
   2.109 +	elif [[ "${countPoms}" -eq "1" ]] && [[ "${countJars}" -eq "0" ]] ; then
   2.110 +		pomFile=`ls -1 *.pom 2>/dev/null`
   2.111 +		cp ${pomFile} ${TEMP_DIR}/${pomFile} 2>/dev/null
   2.112 +		# deploy the local pom file to the remote repo
   2.113 +		mvn deploy:deploy-file \
   2.114 +			-DrepositoryId=${DEPLOY_REPO_ID} \
   2.115 +			-Durl=${DEPLOY_REPO_URL} \
   2.116 +			-DpomFile=${TEMP_DIR}/${pomFile} \
   2.117 +			-Dfile=${TEMP_DIR}/${pomFile};
   2.118 +		if [[ "$?" -ne "0" ]] ; then echo "Error occured while processing directory '${d}' (temp dir is '${TEMP_DIR}'"; exit; fi
   2.119 +	elif [[ "${countPoms}" -gt "1" ]] && [[ "${countJars}" -eq "0" ]] ; then
   2.120 +		# deploy the local pom files to the remote repo
   2.121 +		for pom in `ls -1 *.pom` ; do
   2.122 +			pomFile=${pom};
   2.123 +			cp ${pomFile} ${TEMP_DIR}/${pomFile} 2>/dev/null;
   2.124 +			mvn deploy:deploy-file \
   2.125 +				-DrepositoryId=${DEPLOY_REPO_ID} \
   2.126 +				-Durl=${DEPLOY_REPO_URL} \
   2.127 +				-DpomFile=${TEMP_DIR}/${pomFile} \
   2.128 +				-Dfile=${TEMP_DIR}/${pomFile};
   2.129 +			if [[ "$?" -ne "0" ]] ; then echo "Error occured while processing directory '${d}' (temp dir is '${TEMP_DIR}'"; exit; fi
   2.130 +		done
   2.131 +	else
   2.132 +		echo "Found ${countPoms} poms and ${countJars} jars in directory '${d}' (temp dir is '${TEMP_DIR}')."
   2.133 +		echo "What should I do?"
   2.134 +		echo "Aborting..."
   2.135 +		exit;
   2.136 +	fi
   2.137 +
   2.138 +	# grooming
   2.139 +	rm ${TEMP_DIR}/*
   2.140 +done
   2.141 +
   2.142 +
   2.143 +# grooming
   2.144 +rm -rf ${TEMP_DIR}