Skip to content

Commit 0cf1c5a

Browse files
committed
Teach maven-helper about Maven Central
The nar-maven-plugin is now deployed exclusively to Maven Central (actually, OSS Sonatype, but that is mirrored to Maven Central). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a3c0298 commit 0cf1c5a

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

maven-helper.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
# error out whenever a command fails
77
set -e
88

9-
root_url=http://maven.imagej.net/content/repositories
9+
root_url () {
10+
case "$1,$2" in
11+
nar-maven-plugin,*)
12+
echo http://repo1.maven.org/maven2/
13+
;;
14+
*)
15+
echo http://maven.imagej.net/content/repositories/$2
16+
;;
17+
esac
18+
}
1019

1120
die () {
1221
echo "$*" >&2
@@ -91,17 +100,17 @@ project_url () {
91100
version="$(version "$gav")"
92101
case "$version" in
93102
*SNAPSHOT)
94-
echo "$root_url/snapshots/$infix"
103+
echo "$(root_url $artifactId snapshots)/$infix"
95104
;;
96105
*)
97106
# Release could be in either releases or thirdparty; try releases first
98-
project_url="$root_url/releases/$infix"
107+
project_url="$(root_url $artifactId releases)/$infix"
99108
header=$(curl -Is "$project_url/")
100109
case "$header" in
101110
HTTP/1.?" 200 OK"*)
102111
;;
103112
*)
104-
project_url="$root_url/thirdparty/$infix"
113+
project_url="$(root_url $artifactId thirdparty)/$infix"
105114
;;
106115
esac
107116
echo "$project_url"
@@ -118,15 +127,15 @@ jar_url () {
118127
infix="$(groupId "$gav" | tr . /)/$artifactId/$version"
119128
case "$version" in
120129
*-SNAPSHOT)
121-
url="$root_url/snapshots/$infix/maven-metadata.xml"
130+
url="$(root_url $artifactId snapshots)/$infix/maven-metadata.xml"
122131
metadata="$(curl -s "$url")"
123132
timestamp="$(extract_tag timestamp "$metadata")"
124133
buildNumber="$(extract_tag buildNumber "$metadata")"
125134
version=${version%-SNAPSHOT}-$timestamp-$buildNumber
126-
echo "$root_url/snapshots/$infix/$artifactId-$version.jar"
135+
echo "$(root_url $artifactId snapshots)/$infix/$artifactId-$version.jar"
127136
;;
128137
*)
129-
echo "$root_url/releases/$infix/$artifactId-$version.jar"
138+
echo "$(root_url $artifactId releases)/$infix/$artifactId-$version.jar"
130139
;;
131140
esac
132141
}

0 commit comments

Comments
 (0)