首页 > 编程语言 > 详细

maven私服nexus上传第三方jar包以及下载

时间:2019-12-23 09:55:40      阅读:216      评论:0      收藏:0      [点我收藏+]

在maven中,配置setting.xml,之后通过mvn deploy命令可以将包传入私服

有些第三方jar包,我们需要一般通过新建仓库进行上传

setting.xml配置

技术分享图片
<servers>
    <server>
      <id>nexus</id>
      <username>gaming</username>
      <password>gaming</password>
    </server>
</servers>

 

通过cmd窗口手工在后台上传

mvn deploy:deploy-file -DgroupId=net.sf -DartifactId=json-lib -Dversion=2.4 -Dpackaging=jar 
-Dfile=E:/json-lib-2.4.jar -Durl=http://192.168.1.222/nexus/repository/releases/ -DrepositoryId=releases

参数说明

mvn deploy:deploy-file

  • -DgroupId=xxxxxx 就相当于pom中的groupId
  • -DartifactId=xxxxxx 就相当于pom中的artifactId
  • -Dversion=xxxxxx 就相当于pom中的版本号version
  • -Dpackaging=xxxxxx 就相当于pom中打包方式
  • -Dfile=xxxxxx 本地环境
  • -Durl=xxxxxx 上传的url
  • -DrepositoryId=xxxxxx 对应的是setting.xml 里边的id

 

下载,需要修改maven的setting.xml

设置repository
技术分享图片

 之后reimport即可。

maven私服nexus上传第三方jar包以及下载

原文:https://www.cnblogs.com/wang3680/p/12081961.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!