11#! /bin/bash
2+ # Licensed to the Apache Software Foundation (ASF) under one
3+ # or more contributor license agreements. See the NOTICE file
4+ # distributed with this work for additional information
5+ # regarding copyright ownership. The ASF licenses this file
6+ # to you under the Apache License, Version 2.0 (the
7+ # "License"); you may not use this file except in compliance
8+ # with the License. You may obtain a copy of the License at
9+ #
10+ # http://www.apache.org/licenses/LICENSE-2.0
11+ #
12+ # Unless required by applicable law or agreed to in writing,
13+ # software distributed under the License is distributed on an
14+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ # KIND, either express or implied. See the License for the
16+ # specific language governing permissions and limitations
17+ # under the License.
18+ #
19+ # This script should be used to install additional dependencies
20+ # This includes: installing ubuntu packages, custom services
21+ # or internet downloads.
22+
23+ # Authored by Rafael da Fonseca <rsafonseca@gmail.com>
224
325# Get all dependency blocks from all pom.xml files in the project
426for line in $( find ../../ -name pom.xml -exec sed -n ' /<dependencies>/{: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 '/<dependencies>/{:a;n;/<\/
729 set -- $( echo $line | awk -v FS=" (>|<)" ' {print $2, $3}' )
830
931 # Start processing data
10-
1132 if [[ $1 == " dependency" ]]; then
1233 # Create new artifact dep
1334 unset ARTIFACT
@@ -18,10 +39,12 @@ for line in $(find ../../ -name pom.xml -exec sed -n '/<dependencies>/{:a;n;/<\/
1839 if [[ $GROUP != * org.apache.cloudstack* ]] && [[ $GROUP != * com.cloud* ]] && [[ $ARTIFACT != cloudstack-service-console-proxy-rdpclient ]]; then
1940 if [[ -z $VERSION ]] ; then
2041 VERSION=LATEST
42+ # These dependencies don't support the LATEST keywork for some reason, and would cause mvn runs to file on dummy poms
2143 if [[ $GROUP == jstl ]] || [[ $ARTIFACT == mysql-connector-java ]] || [[ $GROUP == org.apache.axis ]]; then
2244 continue
2345 fi
2446 fi
47+ # Output resolved dependency to a file, to be picked up later
2548 echo " $GROUP $ARTIFACT $VERSION " >> deps.out
2649 fi
2750 elif [[ $1 == " version" ]]; then
89112 if [[ $? -ne 0 ]]; then
90113 RETURN_CODE=1
91114 fi
92-
93115done
94116
95117# Run a few plugin goals to download some more deps
113135 done < <( grep $PLUGIN cleandeps.out)
114136done
115137echo " Running $JOBS "
138+ # Call all the constructed plugin goals
116139mvn $JOBS -f pom0.xml
117140if [[ $? -ne 0 ]]; then
118141 RETURN_CODE=1
0 commit comments