I am using a shell script to download a number of jar files from maven central repo using direct links (e.g. - this link). I read on a couple of sources that Google hosts a publicly available copy of all the Maven Central artifacts and using it instead of Maven Central provides significant speed up in terms of download speed.
However, to achieve this I could only find out the Maven settings.xml references for using Google mirror (like below):
<settings>
<mirrors>
<mirror>
<id>google-maven-central</id>
<name>GCS Maven Central mirror Asia Pacific</name>
<url>https://maven-central-asia.storage-download.googleapis.com/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
But this doesn't solve my purpose. I am looking for direct download links to be used in a shell script and not in a maven project. How to do that?
I found the answer to my question. It was easy, you just need to replace the host in the complete URL of the artifact/jar from maven central to google mirror. The structure of the URL looks like:
<HOST><Path to artifact>
Host can assume values of either the maven central repo host or of any mirror for the maven repo.
Example: