Configure Your Own Maven Repository using FTP/SCP/SSH in Ubuntu Server

Running your own Maven repository is dirt simple. All you need is a web server where you can upload files
Maven supports FTP, SCP, WebDAV, and more exotic protocols like Subversion to publish artifacts to remote maven repository.

[1] Install and Configure web server

Install a web server (Apache HTTP Server or Nginx )

$ sudo apt-get install apache2
$ mkdir /var/www/maven-repo

[2] Install FTP server

Install FTP server (VSFTPD)

$ sudo apt-ge install vsftpd
$ sudo vim /etc/vsftpd.conf (edit on your behalf)
$ sudo service vsftpd restart

[3] Configure Your Project Deployment

Open up your awesome software project and edit the pom.xml file. You’re going to add two new sections, ending up with a file that looks like this:
<project ...="">
<name>The Awesome Library</name>



[4] Configure Your Server Credentials

You can find settings.xml in your personal Maven cache directory. On Unix-like systems, it should be at ~/.m2/settings.xml. You may have to create the file if it doesn’t already exist. Here’s what it should contain:
<settings xmlns:xsi="" xmlns="" xsi:schemalocation="">
The is the same as in our pom.xml. The user name and password are the credentials for your FTP server.

[5] Deploy

$ mvn deploy

[6] Make your library available to user

Now, anyone who wants to use your awesome library can just add a dependency to their pom.xml, like this:


<name>My Private Repository</name>


Now have fun :)


Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

How about properly sourcing this if you even copy the bloody wording of the original post?!