发布jar项目到maven仓库

在要发布的项目pom文件中添加配置:

<distributionManagement>
    <repository>
        <id>releases</id>
        <name> Nexus Release Repository</name>
        <url> http://10.127.64.1:8081/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
        <id>snapshots</id>
        <name> Nexus Snapshot Repository</name>
        <url> http://10.127.64.1:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
</distributionManagement>

 

在此,url都是nexus相应仓库的链接地址,这一步做完之后,已经完成了发布所需要的基本配置。【试试命令:mvn deploy】
注意:<repository>、<snapshotRepository>的<id> 要和 <server>中的<id>一致,maven在发布时,会根据此id来查找相应的用户名密码进行登录验证并上传文件。

 

修改apache-maven-3.2.3-bin/settings.xml

<servers>
      <server>
        <id>releases</id>
        <username>admin</username>
        <password>admin</password>
       </server>
       <server>
        <id>snapshots</id>
        <username>admin</username>
        <password>admin</password>
    </server> 
</servers>

此处设置的用户名和密码都是nexus的登陆配置

 

转载于:https://www.cnblogs.com/gavinYang/p/11197788.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值