2.Nexus更新索引


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后看到許多文件的話就說明更新成功

1.Nexus安裝與配置

2.Nexus更新索引

3.發布Maven項目到nexus中

4.按項目類型分配不同的nexus工廠來發布不同的項目

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM