maven(四)--搭建nexus私服,上传下载jar、源码jar

如题,本篇我们介绍下centos7中搭建nexus私服以及如何上传、下载jar包等。

一、centos7中安装nexus2

 下载nexus-2.14.4-03-bundle.tar.gz  ,上传到centos服务器

 cd  installpkg 

 tar  -zxvf    nexus-2.14.4-03-bundle.tar.gz   -C ../app/

 cd   ../app 

 mkdir  nexus2 

  mv   nexus-2.14.4-03   nexus2/

  mv    sonatype-work    nexus2/

  nexus服务启动、停止等命令 :

  cd nexus2/nexus-2.14.4-03/bin 
./nexus console 在当前控制台窗口启动,按ctrl+c结束进程
./nexus  start   后台进程启动nexus服务,可查看 logs目录中wrapper.log 输出日志
./nexus stop   停止nexus服务。

./nexus restart 重启 

./nexus  status 查看服务运行状态

注意:启动、停止服务,不要使用root账号(报错),使用一个其他的普通账户即可。

 

二、nexus2配置中央仓库,指向国内镜像(阿里云)

启动 nexus服务后,可使用浏览器访问 http://ip:8081/nexus 进入管理界面。

nexus中存在的内置账号 admin/admin123(管理员)  、 deployment/deployment123(部署员) 。

我们使用admin登录上后,找到左侧repository,找到central仓库

在configuration 中,我们发现 默认的remote storage location 值为: https://repo1.maven.org/maven2/,Download Remote Indexes 为False。

我们需要将remote storage location 值改为http://maven.aliyun.com/nexus/content/repositories/central/ ,Download Remote Indexes 值改为True

 

三、上传本地jar、源码jar到nexus私服

1、上传jar包到nexus私服 ,选择releases仓库,找到artifact upload 选项卡,填写GAV ,上传即可。

注意:选择的本地文件名可以是任意的,因为上传到nexus上后,nexus会根据jar的GAV坐标来重命名并保存起来(建立索引)

2、上传源码jar包到nexus私服 ,选择releases仓库,找到artifact upload 选项卡。填写GAV ,与上传jar相同。上传源码jar包还

需要配置classifier为sources  (注意不是source) ,然后点击添加、上传即可。

 

三、从nexus下载jar包、下载源码jar包

搜索、找到我们刚上传的 eucp-sms-sdk-1.3.3.jar 和eucp-sms-sdk-1.3.3-sources.jar ,点击download即可下载。 

ok!!!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值