eclipse 上传 maven项目到私服(nexus)

本文介绍如何配置Maven项目以便将其部署到Nexus仓库。主要步骤包括:在pom.xml中设置distributionManagement,指定release和snapshot的URL,并在settings.xml中配置认证信息。完成这些设置后,可以通过Eclipse的maven build命令进行部署。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

创建maven项目,想要上传的nexux上,用于其它maven项目使用

1,在要上传的maven项目的pom.xml配置文件中,添加

<distributionManagement>

<repository>

<id>nexus-releases</id>

<name>Nexus Release Repository</name>

<url>http://192.168.183.130:8081/nexus/content/repositories/releases/</url>

</repository>

<snapshotRepository>

<id>nexus-snapshots</id>

<name>Nexus Snapshot Repository</name>

<url>http://192.168.183.130:8081/nexus/content/repositories/snapshots/</url>

</snapshotRepository>

</distributionManagement>


repository 是上传Release 版本的jar包,snapshotRepository是上传snapshot的jar包

其中两个 id 的值 (nexus-releases,nexus-snapshots)  是在maven_home\conf\settings.xml配置文件中 services 配置的id


<servers>

  

  <server>

      <id>nexus</id>

      <username>admin</username>

      <password>admin123</password>

    </server>

    

    <server>

      <id>nexus-releases</id>

      <username>admin</username>

      <password>admin123</password>

    </server>

    

    <server>

      <id>nexus-snapshots</id>

      <username>admin</username>

      <password>admin123</password>

    </server>


</servers>

2,以上配置完成以后,点击eclipse  run as --- > maven build--> deploy,如果控制台输出 不利的success,则表示发布成功165646_WVMm_1248906.png

165800_xm5V_1248906.png

转载于:https://my.oschina.net/chengpeng/blog/390437

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值