nexus无法下载index的解决

使用nexus配置私服后,update index后,log里看日志,连接都失败了,包括oschina,尝试后也失败了。
解决方案:
1. 下载2个文件:
http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties
http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz
2. 本地的nginx或apache里,建个目录maven2/.index,再修改下hosts文件,把repo1.maven.org指向localhost。
3. 去nexus里,执行update index,它就会找到本地的文件,下载到nexus里去了

成功后,可以在sonatype-work/nexus/indexer/central-ctx下面,找到这2个文件。

另外一种方法比较简单,下载下indexer-cli-5.1.1.jar,然后和nexus-maven-repository-index.properties nexus-maven-repository-index.gz文件,一起放在一个目录里,然后执行 java -jar indexer-cli-5.1.1.jar -u nexus-maven-repository-index.gz -d indexer ,10分钟左右的时候,会生成一个indexer目录,把这个目录下的文件,全都拷贝到sonatype-work/nexus/indexer/central-ctx下面,最后重新启动nexus,就可以看到index效果了。

另外记得添加了oschina后,在group里,加上它。

ps:update index后,可以在左侧的administration下面的Scheduled Tasks里,看到执行状态
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值