@@ -11,7 +11,12 @@ Options:
1111
1212 -h display this help and exit
1313 -v, --verification-mode MODE use the corresponding verification mode
14- (online or offline). Default is online.
14+ (online or offline). In online mode, keys
15+ are downloaded from a keyserver. In offline
16+ mode, keys are read from local key store.
17+ Default is online.
18+ -r, --repo-base-url URL use the provided URL to fecth signature
19+ files. Default is https://repo1.maven.org/maven2.
1520 -k, --keyserver SERVER use the provided keyserver for online
1621 operations. Default is keyserver.ubuntu.com.
1722 -b, --bootstrap-online-keys KEYS download from the keyserver the keys with
@@ -75,6 +80,25 @@ while :; do
7580 --verification-mode=)
7681 die ' ERROR: "--verification-mode" requires an option argument.'
7782 ;;
83+ -r | --repo-base-url)
84+ if [ -z ${2+x} ]; then
85+ REPO_BASE_URL=${2}
86+ shift
87+ else
88+ die ' ERROR: "--repo-base-url" requires an option argument.'
89+ fi
90+ ;;
91+ --repo-base-url=?* )
92+ if [ " ${1#* =} " ]; then
93+ REPO_BASE_URL=${1#* =}
94+ shift
95+ else
96+ die ' ERROR: "--repo-base-url" requires an option argument.'
97+ fi
98+ ;;
99+ --repo-base-url=)
100+ die ' ERROR: "--repo-base-url" requires an option argument.'
101+ ;;
78102 -k | --keyserver)
79103 if [ -z ${2+x} ]; then
80104 KEYSERVER=${2}
@@ -145,6 +169,10 @@ while :; do
145169 esac
146170done
147171
172+ if [ -z ${REPO_BASE_URL+x} ]; then
173+ REPO_BASE_URL=' https://repo1.maven.org/maven2'
174+ fi
175+
148176if [ -z ${VERIFICATION_MODE+x} ]; then
149177 VERIFICATION_MODE=' online'
150178fi
@@ -192,8 +220,8 @@ for artifact in "${@}"; do
192220 else
193221 artifactClassifierSuffix=" -${coordinates[3]} "
194222 fi
195- artifactUrl=" https://repo1.maven.org/maven2/${groupId// \. // } /${artifactId} /${artifactVersion} /${artifactId} -${artifactVersion}${artifactClassifierSuffix} .${artifactExtension} "
196223 artifactFile=" ${artifactId} -${artifactVersion}${artifactClassifierSuffix} .${artifactExtension} "
224+ artifactUrl=" ${REPO_BASE_URL} /${groupId// \. // } /${artifactId} /${artifactVersion} /${artifactFile} "
197225 signatureUrl=" ${artifactUrl} .asc"
198226 signatureFile=" ${artifactFile} .asc"
199227 \e cho Downloading " ${artifactUrl} "
0 commit comments