Hello,
Recently, I noticed that java maven builds on travis implicitly started using google-maven-central (https://travis-ci.org/pragmatic-objects/oo-memoized/builds/592956800). However, I also noticed that google-maven-central is really slow when it comes to syncing the changes from official source. And it really frustrates me: I see my artifact deployed in http://repo1.maven.org/maven2, I see it in search via mvnrepository.com, but the builds that are dependent on it keep failing for hours since the moment of deployment.
I’d like to switch my builds back to official maven central. Is there an option for that? I’d be grateful for any advice, though an option that doesn’t involve touching configs on project side would be more preferrable.
3 Likes
I want this too. Google’s mirror of Maven Central is taking too long to sync with the upstream.
Update: To get around the Google mirror, you can set the real Maven central as a mirror in a settings.xml file and pass that to the mvn command with -s. For an example: https://github.com/ksclarke/vertx-super-s3/blob/master/src/test/resources/settings.xml#L21 and https://github.com/ksclarke/vertx-super-s3/blob/master/.travis.yml#L17
1 Like
Since you are in control of the build environment to a large extent, you should be able to manually specify the server for Maven to use.
lesv
4
If you are using the gcs maven mirror it’s now at most 2h behind maven-central and syncs 12 times / day.
Be sure to have updated URL as described in: https://maven-central.storage-download.googleapis.com/index.html
<settings>
<mirrors>
<mirror>
<id>google-maven-central</id>
<name>GCS Maven Central mirror</name>
<url>https://maven-central.storage-download.googleapis.com/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
2 Likes
lesv
6
@adriancole - my understanding is that you need to clear your build-cache to get the new path to take effect.
Agreed. Yep, if anyone runs into this, clear the build cache and you won’t need to override the .settings file.
Thanks for the help.