博客详情

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

作者: 朝如青丝暮成雪
发布时间:2018-07-25 14:25:32  文章分类:maven   阅读(2444)  评论(0)

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


一、centos7中安装nexus2

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

百度网盘下载, 链接:http://pan.baidu.com/s/1bo5l5Vp 密码:df1t


 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

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

(华为云remote repo : https://mirrors.huaweicloud.com/repository/maven/)



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

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

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

 


1、上传源码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!!!




关键字:  maven  mvn  nexus  私服
评论信息
暂无评论
发表评论

亲,您还没有登陆,暂不能评论哦! 去 登陆 | 注册

博主信息
   
数据加载中,请稍候...
文章分类
   
数据加载中,请稍候...
阅读排行
 
数据加载中,请稍候...
评论排行
 
数据加载中,请稍候...

Copyright © 叮叮声的奶酪 版权所有
备案号:鄂ICP备17018671号-1

鄂公网安备 42011102000739号