Skip to content

Commit 1ef184b

Browse files
authored
Do not use the deprecated repoUrl mvn option when downloading the test jars [API-2183] (#1216)
* Do not use the deprecated `repoUrl` mvn option but use the `remoteRepositories` option instead. * Updated the remote controller script so that it does not use the deprecated download options, and it works with newer mvn versions.
1 parent cef6d68 commit 1ef184b

File tree

2 files changed

+23
-28
lines changed

2 files changed

+23
-28
lines changed

scripts/start-rc.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if exist "hazelcast-remote-controller-%HAZELCAST_RC_VERSION%.jar" (
2626
echo "hazelcast-remote-controller-%HAZELCAST_RC_VERSION%.jar already exist, not downloading from maven."
2727
) else (
2828
echo "Downloading: remote-controller jar com.hazelcast:hazelcast-remote-controller:%HAZELCAST_RC_VERSION%"
29-
call 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 || (
29+
call mvn -q dependency:get -Dtransitive=false -DremoteRepositories=%SNAPSHOT_REPO% -Dartifact=com.hazelcast:hazelcast-remote-controller:%HAZELCAST_RC_VERSION% -Ddest=hazelcast-remote-controller-%HAZELCAST_RC_VERSION%.jar || (
3030
echo "Failed download remote-controller jar com.hazelcast:hazelcast-remote-controller:%HAZELCAST_RC_VERSION%"
3131
exit /b 1
3232
)
@@ -36,7 +36,7 @@ if exist "hazelcast-%HAZELCAST_TEST_VERSION%-tests.jar" (
3636
echo "hazelcast-%HAZELCAST_TEST_VERSION%-tests.jar already exists, not downloading from maven."
3737
) else (
3838
echo "Downloading: hazelcast test jar com.hazelcast:hazelcast:%HAZELCAST_TEST_VERSION%:jar:tests"
39-
call 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 || (
39+
call mvn -q dependency:get -Dtransitive=false -DremoteRepositories=%SNAPSHOT_REPO% -Dartifact=com.hazelcast:hazelcast:%HAZELCAST_TEST_VERSION%:jar:tests -Ddest=hazelcast-%HAZELCAST_TEST_VERSION%-tests.jar || (
4040
echo "Failed download hazelcast test jar com.hazelcast:hazelcast:%HAZELCAST_TEST_VERSION%:jar:tests"
4141
exit /b 1
4242
)
@@ -46,7 +46,7 @@ if exist "hazelcast-sql-%HZ_VERSION%.jar" (
4646
echo "hazelcast-sql-%HZ_VERSION%.jar already exists, not downloading from maven."
4747
) else (
4848
echo "Downloading: hazelcast-sql-%HZ_VERSION%.jar com.hazelcast:hazelcast-sql:%HZ_VERSION%:jar"
49-
call mvn -q dependency:get -Dtransitive=false -DrepoUrl=%SNAPSHOT_REPO% -Dartifact=com.hazelcast:hazelcast-sql:%HZ_VERSION%:jar -Ddest=hazelcast-sql-%HZ_VERSION%.jar || (
49+
call mvn -q dependency:get -Dtransitive=false -DremoteRepositories=%SNAPSHOT_REPO% -Dartifact=com.hazelcast:hazelcast-sql:%HZ_VERSION%:jar -Ddest=hazelcast-sql-%HZ_VERSION%.jar || (
5050
echo "Failed download hazelcast test jar com.hazelcast:hazelcast-sql:%HZ_VERSION%:jar"
5151
exit /b 1
5252
)
@@ -56,7 +56,7 @@ if exist "hazelcast-enterprise-%HAZELCAST_ENTERPRISE_VERSION%.jar" (
5656
echo "hazelcast-enterprise-%HAZELCAST_ENTERPRISE_VERSION%.jar already exists, not downloading from maven."
5757
) else (
5858
echo "Downloading: hazelcast enterprise jar com.hazelcast:hazelcast-enterprise:%HAZELCAST_ENTERPRISE_VERSION%"
59-
call mvn -q dependency:get -Dtransitive=false -DrepoUrl=%ENTERPRISE_REPO% -Dartifact=com.hazelcast:hazelcast-enterprise:%HAZELCAST_ENTERPRISE_VERSION% -Ddest=hazelcast-enterprise-%HAZELCAST_ENTERPRISE_VERSION%.jar || (
59+
call mvn -q dependency:get -Dtransitive=false -DremoteRepositories=%ENTERPRISE_REPO% -Dartifact=com.hazelcast:hazelcast-enterprise:%HAZELCAST_ENTERPRISE_VERSION% -Ddest=hazelcast-enterprise-%HAZELCAST_ENTERPRISE_VERSION%.jar || (
6060
echo "Failed download hazelcast enterprise jar com.hazelcast:hazelcast-enterprise:%HAZELCAST_ENTERPRISE_VERSION%"
6161
exit /b 1
6262
)

scripts/start-rc.sh

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ function version_greater_equal()
55
printf '%s\n%s\n' "$2" "$1" | sort --check=quiet --version-sort
66
}
77

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+
823
function cleanup {
924
echo "cleanup is being performed."
1025
if [ "x${rcPid}" != "x" ]
@@ -41,23 +56,13 @@ fi
4156
if [ -f "hazelcast-remote-controller-${HAZELCAST_RC_VERSION}.jar" ]; then
4257
echo "remote controller already exist, not downloading from maven."
4358
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}"
5060
fi
5161

5262
if [ -f "hazelcast-${HAZELCAST_TEST_VERSION}-tests.jar" ]; then
5363
echo "hazelcast-test.jar already exists, not downloading from maven."
5464
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"
6166
fi
6267

6368
version_greater_equal ${HZ_VERSION} 4.2.0
@@ -72,24 +77,14 @@ if [[ ${INCLUDE_SQL} -eq "1" ]]; then
7277
if [ -f "hazelcast-sql-${HZ_VERSION}.jar" ]; then
7378
echo "hazelcast-sql-${HZ_VERSION}.jar already exists, not downloading from maven."
7479
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"
8181
fi
8282
fi
8383

8484
if [ -f "hazelcast-enterprise-${HAZELCAST_ENTERPRISE_VERSION}.jar" ]; then
8585
echo "hazelcast-enterprise.jar already exists, not downloading from maven."
8686
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"
9388
fi
9489

9590
if [ -f "hazelcast-enterprise-${HAZELCAST_ENTERPRISE_VERSION}-tests.jar" ]; then

0 commit comments

Comments
 (0)