Skip to content


maven 发布项目到nexus服务器中

首先对Nexus服务器的Repositories中的类型有个了解,主要分为group、Hosted、Proxy和Virtual四种类型。
我们只能用Hosted作为发布的目标仓库。
1、配置.m2/settings.xml

<servers>
  <server>
    <id>nexus-releases</id>
     <username>admin</username>
     <password>****</password>
  </server>
   <server>
     <id>nexus-snapshots</id>
     <username>admin</username>
     <password>****</password>
   </server>
 </servers>

2.配置项目POM.xml



nexus-releases
public
http://localhost:8080/nexus/content/repositories/releases


nexus-snapshots
Snapshots
http://localhost:8080/nexus/content/repositories/snapshots


3.发布项目
进入项目目录执行mvn deploy结束后,构件就自动加入到服务器中,其他项目就可以进行关联引用。

参考:
Maven2部署构件到Nexus时出现的Failed to transfer file错误
Maven2中需要注意的问题
maven deploy到nexus私服出错问题

Tags: java, maven, nexus, 发布, 项目

相关文章

Posted in 程序.

Tagged with , , , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

You must be logged in to post a comment.