From 6fd49e49a3c70c57355eeeb8af2656528da596e1 Mon Sep 17 00:00:00 2001 From: Rafael da Fonseca Date: Sun, 21 Jun 2015 04:35:14 +0200 Subject: [PATCH] Add apache license header to script Signed-off-by: Daan Hoogland This closes #482 --- tools/travis/before_install.sh | 3 +++ tools/travis/downloadDeps.sh | 27 +++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/tools/travis/before_install.sh b/tools/travis/before_install.sh index 69646a754c7..b0d33a16031 100755 --- a/tools/travis/before_install.sh +++ b/tools/travis/before_install.sh @@ -97,6 +97,7 @@ done echo -e "\nDownloading Plugin dependencies" for ((i=0;i<$RETRY_COUNT;i++)) do + #The output file is used on the next phase by the downloadDeps.sh script mvn org.apache.maven.plugins:maven-dependency-plugin:resolve-plugins | grep "Plugin Resolved:" | sort -u | awk '{print $4}' | tee /tmp/resolvedPlugins if [[ $? -eq 0 ]]; then echo -e "\nPlugin dependencies downloaded successfully" @@ -120,9 +121,11 @@ do break; fi echo -e "\nDependency download failed" + #Print out errors from failed run cat /tmp/phase2 | grep -i -e "fail" -e "error" -e "exception" #Test DNS record getent hosts repo1.maven.org while ! nc -vzw 5 repo1.maven.org 80; do echo -e "\nFailed to connect to repo1.maven.org:80 will retry in 10 seconds"; sleep 10; done + echo -e "\nRetrying download" done cd ../.. diff --git a/tools/travis/downloadDeps.sh b/tools/travis/downloadDeps.sh index 5d9a033583a..b4617ec7f1e 100755 --- a/tools/travis/downloadDeps.sh +++ b/tools/travis/downloadDeps.sh @@ -1,4 +1,26 @@ #!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# This script should be used to install additional dependencies +# This includes: installing ubuntu packages, custom services +# or internet downloads. + +# Authored by Rafael da Fonseca #Get all dependency blocks from all pom.xml files in the project for line in $(find ../../ -name pom.xml -exec sed -n '//{:a;n;/<\/dependencies>/b;p;ba}' {} \; | grep -e "artifactId" -e "groupId" -e "version" -e "dependency\>" -e "exclusion\>" -e "exclusions\>"| sed -e 's/\^M//'); do @@ -7,7 +29,6 @@ for line in $(find ../../ -name pom.xml -exec sed -n '//{:a;n;/<\/ set -- $(echo $line | awk -v FS="(>|<)" '{print $2, $3}') #Start processing data - if [[ $1 == "dependency" ]]; then #Create new artifact dep unset ARTIFACT @@ -18,10 +39,12 @@ for line in $(find ../../ -name pom.xml -exec sed -n '//{:a;n;/<\/ if [[ $GROUP != *org.apache.cloudstack* ]] && [[ $GROUP != *com.cloud* ]] && [[ $ARTIFACT != cloudstack-service-console-proxy-rdpclient ]]; then if [[ -z $VERSION ]] ; then VERSION=LATEST + #These dependencies don't support the LATEST keywork for some reason, and would cause mvn runs to file on dummy poms if [[ $GROUP == jstl ]] || [[ $ARTIFACT == mysql-connector-java ]] || [[ $GROUP == org.apache.axis ]]; then continue fi fi + #Output resolved dependency to a file, to be picked up later echo "$GROUP $ARTIFACT $VERSION" >> deps.out fi elif [[ $1 == "version" ]]; then @@ -89,7 +112,6 @@ do if [[ $? -ne 0 ]]; then RETURN_CODE=1 fi - done #Run a few plugin goals to download some more deps @@ -113,6 +135,7 @@ do done < <(grep $PLUGIN cleandeps.out) done echo "Running $JOBS" +#Call all the constructed plugin goals mvn $JOBS -f pom0.xml if [[ $? -ne 0 ]]; then RETURN_CODE=1