使用Nexus搭建Maven私服(二)-更新私有仓库索引

使用Nexus搭建Maven私服(二)-更新私有仓库索引

    上一节内容已经介绍如何安装安装Nexus搭建Maven私服,本章具体介绍更新私有仓库索引的方式

更新私有仓库索引的方式

    (1)设置Central Repository --》 Download Remote Indexes:True 打开自动更新仓库索引

             该种方式通过远程下载更新私有仓库,由于文件过大,且访问一些国外下载地址,更新较慢,基本上很难进行完成更新,推荐使用手动更新

    (2)手动更新仓库索引

自动方式更新私有仓库索引

--》访问搭建的Nexus服务,http://ip:port/nexus

--》使用默认用户名/密码:admin/admin123,进行登录

--》设置Central Repository --》 Download Remote Indexes:True 打开自动更新仓库索引

--》查询下载任务(一般情况下全部下载速度时非常慢的这里我们取消采用手动更新)

--》取消下载任务

--》完成

手动方式更新私有仓库索引

    下载索引文件

         (1)indexer-cli-5.1.0.jar

                  下载地址:http://maven.outofmemory.cn/org.apache.maven.indexer/indexer-cli/5.1.0/

         (2)nexus-maven-repository-index.gz

                  下载地址:https://repo.maven.apache.org/maven2/.index/

         (3)nexus-maven-repository-index.properties

                  下载地址:https://repo.maven.apache.org/maven2/.index/

    手动更新步骤

--》进入Nexus安装目录,创建index目录上传下载文件

--》进入index目录

cd /usr/local/nexus2.14/index

--》执行命令,解压nexus-maven-repository-index.gz包需要耗费一段时间,需耐心等待解压完成

java -jar indexer-cli-5.1.0.jar -u nexus-maven-repository-index.gz -d indexer

--》停止nexus服务

cd /usr/local/nexus2.14/nexus-2.14.13-01/bin
./nexus stop

--》删除原有的索引文件(这里需注意一定检查一下是否是central-ctx目录,不要错误其他目录将所有文件删除了,特别是跟目录)

cd /usr/local/nexus2.14/sonatype-work/nexus/indexer/central-ctx
ls
rm -rf *

--》将解压的所有索引文件拷贝到central-ctx目录

cd /usr/local/nexus2.14/index/indexer
ls
cp -r * /usr/local/nexus2.14/sonatype-work/nexus/indexer/central-ctx

--》启动nexus

cd /usr/local/nexus2.14/nexus-2.14.13-01/bin
./nexus start

--》访问nexus的web服务,登录查看索引是否更新完成

--》完成

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

丨Anna丨

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值