@@ -5,6 +5,21 @@ function version_greater_equal()
5
5
printf ' %s\n%s\n' " $2 " " $1 " | sort --check=quiet --version-sort
6
6
}
7
7
8
+ function downloadFromMaven()
9
+ {
10
+ remoteRepository=$1
11
+ artifact=$2
12
+ echo " Downloading ${artifact} from remote repository: ${remoteRepository} "
13
+ mvn -q dependency:get -Dtransitive=false -DremoteRepositories=${remoteRepository} -Dartifact=${artifact}
14
+ mvn -q dependency:copy -Dartifact=${artifact} -DoutputDirectory=.
15
+ if [ $? -ne 0 ]; then
16
+ echo " Failed download to download ${artifact} from remote repository: ${remoteRepository} "
17
+ exit 1
18
+ else
19
+ echo " Downloaded ${artifact} from remote repository: ${remoteRepository} "
20
+ fi
21
+ }
22
+
8
23
function cleanup {
9
24
echo " cleanup is being performed."
10
25
if [ " x${rcPid} " != " x" ]
41
56
if [ -f " hazelcast-remote-controller-${HAZELCAST_RC_VERSION} .jar" ]; then
42
57
echo " remote controller already exist, not downloading from maven."
43
58
else
44
- echo " Downloading: remote-controller jar com.hazelcast:hazelcast-remote-controller:${HAZELCAST_RC_VERSION} "
45
- mvn -q dependency:get -Dtransitive=false -DrepoUrl=${SNAPSHOT_REPO} -Dartifact=com.hazelcast:hazelcast-remote-controller:${HAZELCAST_RC_VERSION} -Ddest=hazelcast-remote-controller-${HAZELCAST_RC_VERSION} .jar
46
- if [ $? -ne 0 ]; then
47
- echo " Failed download remote-controller jar com.hazelcast:hazelcast-remote-controller:${HAZELCAST_RC_VERSION} "
48
- exit 1
49
- fi
59
+ downloadFromMaven ${SNAPSHOT_REPO} " com.hazelcast:hazelcast-remote-controller:${HAZELCAST_RC_VERSION} "
50
60
fi
51
61
52
62
if [ -f " hazelcast-${HAZELCAST_TEST_VERSION} -tests.jar" ]; then
53
63
echo " hazelcast-test.jar already exists, not downloading from maven."
54
64
else
55
- echo " Downloading: hazelcast test jar com.hazelcast:hazelcast:${HAZELCAST_TEST_VERSION} :jar:tests"
56
- mvn -q dependency:get -Dtransitive=false -DrepoUrl=${SNAPSHOT_REPO} -Dartifact=com.hazelcast:hazelcast:${HAZELCAST_TEST_VERSION} :jar:tests -Ddest=hazelcast-${HAZELCAST_TEST_VERSION} -tests.jar
57
- if [ $? -ne 0 ]; then
58
- echo " Failed download hazelcast test jar com.hazelcast:hazelcast:${HAZELCAST_TEST_VERSION} :jar:tests"
59
- exit 1
60
- fi
65
+ downloadFromMaven ${SNAPSHOT_REPO} " com.hazelcast:hazelcast:${HAZELCAST_TEST_VERSION} :jar:tests"
61
66
fi
62
67
63
68
version_greater_equal ${HZ_VERSION} 4.2.0
@@ -72,24 +77,14 @@ if [[ ${INCLUDE_SQL} -eq "1" ]]; then
72
77
if [ -f " hazelcast-sql-${HZ_VERSION} .jar" ]; then
73
78
echo " hazelcast-sql-${HZ_VERSION} .jar already exists, not downloading from maven."
74
79
else
75
- echo " Downloading: hazelcast-sql-${HZ_VERSION} .jar com.hazelcast:hazelcast-sql:${HZ_VERSION} :jar"
76
- mvn -q dependency:get -Dtransitive=false -DrepoUrl=${SNAPSHOT_REPO} -Dartifact=com.hazelcast:hazelcast-sql:${HZ_VERSION} :jar -Ddest=hazelcast-sql-${HZ_VERSION} .jar
77
- if [ $? -ne 0 ]; then
78
- echo " Failed download hazelcast-sql-${HZ_VERSION} .jar com.hazelcast:hazelcast-sql:${HZ_VERSION} :jar"
79
- exit 1
80
- fi
80
+ downloadFromMaven ${SNAPSHOT_REPO} " com.hazelcast:hazelcast-sql:${HZ_VERSION} :jar"
81
81
fi
82
82
fi
83
83
84
84
if [ -f " hazelcast-enterprise-${HAZELCAST_ENTERPRISE_VERSION} .jar" ]; then
85
85
echo " hazelcast-enterprise.jar already exists, not downloading from maven."
86
86
else
87
- echo " Downloading: hazelcast enterprise jar com.hazelcast:hazelcast-enterprise:${HAZELCAST_ENTERPRISE_VERSION} "
88
- mvn -q dependency:get -Dtransitive=false -DrepoUrl=${ENTERPRISE_REPO} -Dartifact=com.hazelcast:hazelcast-enterprise:${HAZELCAST_ENTERPRISE_VERSION} -Ddest=hazelcast-enterprise-${HAZELCAST_ENTERPRISE_VERSION} .jar
89
- if [ $? -ne 0 ]; then
90
- echo " Failed download hazelcast enterprise jar com.hazelcast:hazelcast-enterprise:${HAZELCAST_ENTERPRISE_VERSION} "
91
- exit 1
92
- fi
87
+ downloadFromMaven ${ENTERPRISE_REPO} " com.hazelcast:hazelcast-enterprise:${HAZELCAST_ENTERPRISE_VERSION} :jar"
93
88
fi
94
89
95
90
if [ -f " hazelcast-enterprise-${HAZELCAST_ENTERPRISE_VERSION} -tests.jar" ]; then
0 commit comments