是否可以使用Maven 1部署到Nexus存储库?

时间:2015-06-25 13:54:19

标签: maven nexus

我们的一些项目仍然使用Maven 1.是否可以使用" maven:deploy"将工件部署到Nexus Maven 1存储库?目标?我找不到设置用户名和密码的属性。

我们通过共享Nexus服务器的存储文件夹并使用文件协议直接部署到该文件夹​​找到了解决方法,但这不是一个首选的解决方案。

2 个答案:

答案 0 :(得分:1)

Nexus supports hosted repositories using the Maven 1 format so you can use the usual deployment setup. Unfortunately I do NOT remember how to do the deployment with credentials in Maven 1, but I assume the archived documentation would detail that. If you can not get this to work easily and the project is not VERY complex I would actually suggest to drop Maven 1 and upgrade to Maven 3. This would solve your problem and bring numerous improvements to your development team. Maven 1 has been unsupported and deprecated for years and which puts you into this troublesome situation.

答案 1 :(得分:1)

如果您正在使用Maven 2(不是Maven 3),您还可以通过向您的distributionManagment添加" legacy来以Maven 1格式部署工件

<distributionManagement>
    <repository>
      <id>nexus</id>
      <name>Release Repository</name>
      <url>http://localhost:8081/nexus/content/repositories/maven1</url>
      <layout>legacy</layout>
    </repository>
    ...
  </distributionManagement>

这不能与Maven 3一起使用,在该版本的Maven中删除了旧版布局支持。