Use Azure WebSites to host custom maven repository

I was trying to set up a temporary maven repository to share java libraries. It turns out you can easily do it for free using azure WebSites. Here are step-by-step instructions:

  • Create Azure WebSite. Name “m2” was already taken so I took dotm2 - here it is:
  • Obtain ftp location and deployment credentials. I’d recommend to use site-specific credentials, not user ones. The difference is explained here. In ibiza portal you need to open web site blade and find “Get publish profile” button in blade’s title. It is not visible by default so you’ll need to click on “…” in the blade’s title. I got file like this:
		profileName="dotm2 - FTP" 
		userPWD="password goes here" 

Now you can access web site content by FTP.

  • Since I’ve already opened FTP window to try out deployment credentials - I’ll make one last piece of website configuration. Enable directory browsing. Just create a web.config under “site/wwwroot” with this content:
		<directoryBrowse enabled="true" showFlags="Date,Time,Extension,Size" />
			<mimeMap fileExtension=".pom" mimeType="application/xml" />
			<mimeMap fileExtension=".md5" mimeType="text/plain" />
			<mimeMap fileExtension=".sha1" mimeType="text/plain" />

update(1/3/2015): At the moment of publication I forgot to configure mime types so pom files wasn’t accessible and gradle wasn’t able to resolve dependencies

  • Now FTP deployer can be used to upload jars to my repository. If you are using gradle maven plugin can be configured like shown below (build.gradle file):
apply plugin: 'maven'

configurations {

repositories {

dependencies { 
    deployerJars "org.apache.maven.wagon:wagon-ftp:2.8"

version = "1.0.0-SNAPSHOT"
group = ""

uploadArchives {
    repositories {
        mavenDeployer {
            configuration = configurations.deployerJars

            repository(url: "") { 
                authentication(userName: "dotm2\\\$dotm2", password:javamavenuserpassword)

Note, I’ve used variable “javamavenuserpassword” that you’ll need to supply to gradle to upload artifacts.

  • Build and upload artifacts:
gradlew uploadArchives -Pjavamavenuserpassword=<password goes here>

That’s it. Now you can use artifacts from your repository like this:

repositories {

    maven {
        url ''


comments powered by Disqus