码迷,mamicode.com
首页 > 其他好文 > 详细

Nexus更新索引

时间:2016-12-13 23:09:57      阅读:279      评论:0      收藏:0      [点我收藏+]

标签:key   命令   apache   方式   mave   执行   plain   http   pad   

1.手动更新
1.  下载索引文件
在http://repo.maven.apache.org/maven2/.index/ 中下载
nexus-maven-repository-index.gz
nexus-maven-repository-index.properties
然后再下载一个indexer-cli-5.1.0.jar
indexer的下载地址:http://maven.outofmemory.cn/org.apache.maven.indexer/indexer-cli/5.1.0/
indexer的Maven

1
2
3
4
5
<dependency>
    <groupId>org.apache.maven.indexer</groupId>
    <artifactId>indexer-cli</artifactId>
    <version>5.1.0</version>
</dependency>

2.   解压缩索引文件
将上面三个文件(.gz & .properties & .jar)放置到同一目录下,运行如下命令
java -jar indexer-cli-5.1.0.jar -u nexus-maven-repository-index.gz -d indexer
3.   停止nexus
4.   删除原有的索引文件

将{nexus_home}\sonatype-work\nexus\indexer\central-ctx下的文件全部删掉
5.   拷贝索引至central-ctx目录下
将nexus-maven-repository-index.gz解压后的indexer目录中所有文件,放到sonatype-work\nexus\indexer\central-ctx下面
6.   启动nexus即自动更新索引


2.自动下载
1.  打开Repositories标签,选中远程仓库并打开Configuration,将Download Romote Location 设置为true;
2. 在远程仓库上右键选择Update Index,Nexus会自动建立一条任务计划;一般远程仓库都比较大,构建会比较多,索引文件会很大,像http://repo1.maven.org/maven2 就有几百M,因此需要的时间就比较长。
3.  可以进入Scheduled Tasks查看任务的执行情况,当执行完成时,远程仓库的索引就已经建立完毕了。
两种方式,只要Browse_Index后看到许多文件的话就说明更新成功

?技术分享

Nexus更新索引

标签:key   命令   apache   方式   mave   执行   plain   http   pad   

原文地址:http://www.cnblogs.com/thinkpad/p/6172134.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!