Skip to content

Commit 101270b

Browse files
committed
travis-javadoc.sh: use maven.imagej.net as mirror
When maven.imagej.net is defined as a repository in the POM, add it as a mirror in the settings.xml, to avoid Maven Central issues. This might be a bad idea, but we'll give it a try.
1 parent 7058a66 commit 101270b

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

travis-javadoc.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,32 @@ then
4545
openssl_key=$2
4646
openssl_iv=$3
4747

48+
# Populate the settings.xml configuration.
49+
mkdir -p "$HOME/.m2"
50+
settingsFile="$HOME/.m2/settings.xml"
51+
customSettings=.travis/settings.xml
52+
if [ -f "$customSettings" ]
53+
then
54+
cp "$customSettings" "$settingsFile"
55+
else
56+
# NB: Use maven.imagej.net as sole mirror if defined in <repositories>.
57+
# This hopefully avoids intermittent "ReasonPhrase:Forbidden" errors
58+
# when the Travis build pings Maven Central; see travis-ci/travis-ci#6593.
59+
test -f pom.xml && grep -A 2 '<repository>' pom.xml | grep -q 'maven.imagej.net' &&
60+
cat >"$settingsFile" <<EOL
61+
<settings>
62+
<mirrors>
63+
<mirror>
64+
<id>imagej-mirror</id>
65+
<name>ImageJ mirror</name>
66+
<url>https://maven.imagej.net/content/groups/public/</url>
67+
<mirrorOf>*</mirrorOf>
68+
</mirror>
69+
</mirrors>
70+
</settings>
71+
EOL
72+
fi
73+
4874
# Emit some details useful for debugging.
4975
# NB: We run once with -q to suppress the download messages,
5076
# then again without it to emit the desired dependency tree.

0 commit comments

Comments
 (0)