Creating a remote maven repository came about as I have a simple need to host some Scala artifacts on a remote location for my CircleCI builds and other teammates to have access to any new build artifacts being published. I do want to add a brief warning here that this is not the most secure method of hosting these artifacts as it uses security via obfuscation and not user credentials, however, the JARs I am hosting are simple utilities that could be open sourced so I did not have to worry too much about that.
First I went to my hosting provider and created a new empty website on a subdomain of http://(guid).thinkovator.com. This is going to allow anyone from any location to be able to access my artifacts as long as they know the guid sub domain. Hints the previous warning.
Next I went to the directory of my newly created website is point to and created a web.config file with the following content. This is needed as my hosting provider is Windows based and runs IIS so this will be different for other types of web servers but the concept should be similar.
<configuration> <system.webServer> <directoryBrowse enabled="true" /> <staticContent> <mimeMap fileExtension=".pom" mimeType="application/xml" /> <mimeMap fileExtension=".md5" mimeType="text/plain" /> <mimeMap fileExtension=".sha1" mimeType="text/plain" /> </staticContent> </system.webServer> </configuration>
That should be all there is. You should now be able to go to http://(guid).domain.com and browse the directory. This is needed for the SBT to navigate the maven repository and pull in any dependencies. If you are interested in how to setup your SBT to pull from a remote location feel free to read SBT publishing to a remote location