一:自動更新
選中central,configuration,將Remote Storage Location(代理地址)設置爲:https://repo1.maven.org/maven2/,將Download Remote Indexes設置爲true
右鍵central,選擇最後一項“update index”,優點是操作簡單,不過速度會有點慢。
二:手動更新
從https://repo1.maven.org/maven2/.index/下載
nexus-maven-repository-index.gz 和 nexus-maven-repository-index.properties
從https://repo1.maven.org/maven2/org/apache/maven/indexer/indexer-cli/5.1.1/
下載indexer-cli-5.1.1.jar
將三個文件放在同一目錄,執行如下命令java -jar indexer-cli-5.1.1.jar -u nexus-maven-repository-index.gz -d indexer,
此時會生成一個indexer文件夾,待執行完後,將nexus安裝目錄\nexus2\sonatype-work\nexus\indexer\central-ctx中的內容全部刪除,
並把生成的indexer的內容複製到..\central-ctx中。重啓nexus就可以看到更新後的索引了