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私服出错问题

下面文章或许你还感兴趣

  • Maven发布jar到本地与远程库中
  • 解决Spring Tool Suite和Maven2找不到JDK的问题
  • Maven2 常用命令
  • Maven 2 JasperReports Plugin配置
  • 收藏Flexmojos Adding libraries to compilation
  • Flex开源项目
  • Eclipse .classpath 简要说明
  • 项目管理的测试版发布
  • FWD: Creating an Executable Apache Pivot App using Maven
  • 信息化项目管理的三要素

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>