10

I would like to host a Maven repository for a framework we're working on and its dependencies. Can I just deploy my artifacts to my FTP host using mvn deploy, or should I manually deploy and/or setup some things before being able to deploy artifacts? I only have FTP access to server I want to host the Maven repo on.

The online repository I want to use is not hosted by myself. As I say, I only have FTP access, so if possible, I would like to use that FTP space as a Maven repository. The tools mentioned seem to work when you have full control over the host machine, or at least more than just FTP access since you need to configure the local directories where the repositories will be placed. Is this possible?

Braiam
  • 1
  • 11
  • 47
  • 78
Christophe Herreman
  • 15,895
  • 9
  • 58
  • 86
  • 4
    Please refrain from voting-to-close/voting-to-open until the results of [this meta discussion](http://meta.stackoverflow.com/questions/267047/leave-open-or-vote-to-close-can-i-host-maven-on-an-ftp-server) has been completed. – chue x Jul 29 '14 at 00:57

4 Answers4

21

You might want to have a look at Nexus, a Maven repository manager. We've replaced our local Maven repository with a Nexus-based one and find it tremendously useful.

lindelof
  • 34,556
  • 31
  • 99
  • 140
  • 1
    I'd like to second this vote for Nexus. The software is capable, easy to install and easy to configure. _Maven, the Definitive Guide_, also from SonaType is the most helpful of the three Maven books I've read. Highly recommended! – bendin Nov 08 '08 at 17:20
10

I've successfully used Archiva as my repository for several years ... see http://archiva.apache.org/. It's easy to administer and allows you to configure as many repositories as you need (SNAPSHOT, internal, external, etc).

According to the book "Better Builds with Maven", the most common type of repository is HTTP, this paragraph describes what I think you need:

This chapter will assume the repositories are running from http://localhost:8081/ and that artifacts are deployed to the repositories using the file system. However, it is possible to use a repository on another server with any combination of supported protocols including http, ftp, scp, sftp and more. For more information, refer to Chapter 3.

A Maven 2 repository is simply a specific directory structure, so once you get the transport and server specifications right for the repository and deployment portion of your POMs, it should be completely transparent to your users.

Mohammad Faisal
  • 5,783
  • 15
  • 70
  • 117
Steve Moyer
  • 5,663
  • 1
  • 24
  • 34
6

You can even use Dropbox. All that you need is a public address to access the files generated with mvn deploy, with any of the protocols in the accepted answer.

I guess there are more services that can work in the same way, but I'm not certain about the URL schemes that alternatives to Dropbox may use.

Community
  • 1
  • 1
Trylks
  • 1,458
  • 2
  • 18
  • 31
3

https://maven.apache.org/wagon/wagon-providers/wagon-ftp/ will tell you that you can use ftp to read from an existing repository, but not to create a new one. I don't think that it is impossible in principle, but no one has cared to write all the fiddly code to do the directory management via ftp.

bmargulies
  • 97,814
  • 39
  • 186
  • 310