我可以在FTP服务器上托管Maven,还是应该使用其他东西?

时间:2022-10-19 22:19:04

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? Do I need a tool like Apache Archiva? Note: I only have FTP access to server I want to host the Maven repo on.

我想为我们正在开发的框架及其依赖项托管一个Maven存储库。我可以使用mvn deploy将我的工件部署到我的FTP主机,还是应该在部署工件之前手动部署和/或设置一些东西?我需要像Apache Archiva这样的工具吗?注意:我只有FTP访问服务器我想托管Maven仓库。

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?

我想要使​​用的在线存储库不是由我自己托管的。正如我所说,我只有FTP访问权限,所以如果可能的话,我想将该FTP空间用作Maven存储库。当您完全控制主机,或者至少不仅仅是FTP访问时,所提到的工具似乎有效,因为您需要配置将放置存储库的本地目录。这可能吗?

4 个解决方案

#1


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).

我已成功使用Archiva作为我的存储库多年......请参阅http://archiva.apache.org/。它易于管理,允许您根据需要配置多个存储库(SNAPSHOT,内部,外部等)。

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

根据“Better Build with Maven”一书,最常见的存储库类型是HTTP,本段描述了我认为您需要的内容:

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.

本章假设存储库从http:// localhost:8081 /运行,并且使用文件系统将工件部署到存储库。但是,可以使用支持的协议的任意组合(包括http,ftp,scp,sftp等)在另一台服务器上使用存储库。有关更多信息,请参阅第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.

Maven 2存储库只是一个特定的目录结构,因此一旦您获得了POM的存储库和部署部分的传输和服务器规范,它就应该对您的用户完全透明。

#2


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.

您可能想看一下Maven存储库管理器Nexus。我们用基于Nexus的Maven存储库替换了我们的本地Maven存储库,并发现它非常有用。

#3


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.

你甚至可以使用Dropbox。您需要的只是一个公共地址,用于访问使用mvn deploy生成的文件,以及接受的答案中的任何协议。

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.

我想有更多的服务可以以相同的方式工作,但我不确定Dropbox可能使用的URL方案。

#4


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.

https://maven.apache.org/wagon/wagon-providers/wagon-ftp/将告诉您,您可以使用ftp从现有存储库中读取,但不能创建新存储库。我不认为原则上是不可能的,但是没有人愿意编写所有繁琐的代码来通过ftp进行目录管理。

#1


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).

我已成功使用Archiva作为我的存储库多年......请参阅http://archiva.apache.org/。它易于管理,允许您根据需要配置多个存储库(SNAPSHOT,内部,外部等)。

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

根据“Better Build with Maven”一书,最常见的存储库类型是HTTP,本段描述了我认为您需要的内容:

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.

本章假设存储库从http:// localhost:8081 /运行,并且使用文件系统将工件部署到存储库。但是,可以使用支持的协议的任意组合(包括http,ftp,scp,sftp等)在另一台服务器上使用存储库。有关更多信息,请参阅第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.

Maven 2存储库只是一个特定的目录结构,因此一旦您获得了POM的存储库和部署部分的传输和服务器规范,它就应该对您的用户完全透明。

#2


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.

您可能想看一下Maven存储库管理器Nexus。我们用基于Nexus的Maven存储库替换了我们的本地Maven存储库,并发现它非常有用。

#3


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.

你甚至可以使用Dropbox。您需要的只是一个公共地址,用于访问使用mvn deploy生成的文件,以及接受的答案中的任何协议。

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.

我想有更多的服务可以以相同的方式工作,但我不确定Dropbox可能使用的URL方案。

#4


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.

https://maven.apache.org/wagon/wagon-providers/wagon-ftp/将告诉您,您可以使用ftp从现有存储库中读取,但不能创建新存储库。我不认为原则上是不可能的,但是没有人愿意编写所有繁琐的代码来通过ftp进行目录管理。