You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4f098a1
Browse filesBrowse the repository at this point in the historyBrowse files
#If version tag is empty, add LATEST to avoid maven errors
28
32
elif [[ "$2"=="" ]];then
29
33
VERSION="LATEST"
30
34
else
31
35
VERSION=$2
32
36
fi
33
37
elif [[ $1=="artifactId" ]];then
38
+
#This avoids exclusions inside dependency block to overwrite original dependency
34
39
if [[ -z$ARTIFACT ]];then
35
40
ARTIFACT=$2
36
41
fi
37
42
elif [[ $1=="groupId" ]];then
43
+
#This avoids exclusions inside dependency block to overwrite original dependency
38
44
if [[ -z$GROUP ]];then
39
45
GROUP=$2
40
46
fi
41
47
fi
42
-
43
48
done
44
49
45
50
#Add the resolved plugins to properly download their dependencies
@@ -52,25 +57,28 @@ while read line ; do
52
57
echo$DATA>> deps.out
53
58
done< /tmp/resolvedPlugins
54
59
60
+
#Remove duplicates and sort them, LANG export is needed to fix some sorting issue, sorting is needed for later function that relies on sorted input
55
61
cat deps.out | LANG=C sort -u > cleandeps.out
56
62
63
+
#Define index of pomfiles, to avoid duplicate deps with different versions in pom.xml, several poms are created in case of more than one version of same artifact
57
64
LASTPOM=0
58
65
echo'<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.apache.cloudstack</groupId><artifactId>travis-build-deps</artifactId><name>Download Deps for Travis CI</name><version>1</version><repositories><repository><id>mido-maven-public-releases</id><name>mido-maven-public-releases</name><url>http://cs-maven.midokura.com/releases</url></repository><repository><id>juniper-contrail</id><url>http://juniper.github.io/contrail-maven/snapshots</url></repository></repositories><dependencies>'> pom${LASTPOM}.xml
59
66
whileread line ;do
60
67
set -- $line
61
-
68
+
#This relies on correct sorting, and distributes different versions of same dependency througout different pom files
62
69
if [[ $2==$LASTARTIFACT ]];then
63
70
POMID=$(($POMID+1))
71
+
#If value is greater than current number of poms, create a new one
64
72
if [[ $POMID-gt$LASTPOM ]];then
65
73
LASTPOM=$POMID
74
+
#This outputs the necessary structure to start a pom and also defines the extra repositories
66
75
echo'<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.apache.cloudstack</groupId><artifactId>travis-build-deps</artifactId><name>Download Deps for Travis CI</name><version>1</version><repositories><repository><id>mido-maven-public-releases</id><name>mido-maven-public-releases</name><url>http://cs-maven.midokura.com/releases</url></repository><repository><id>juniper-contrail</id><url>http://juniper.github.io/contrail-maven/snapshots</url></repository></repositories><dependencies>'> pom${LASTPOM}.xml
0 commit comments