1.下載nexus,下載oss版本
2.更改下載的nexus-xxx.war爲nexus.war
3.拷貝到tomcat的webapp目錄下
4.運行tomcat,進入nexus起始頁
5.用admin/admin123登錄
6. 點擊Administration菜單下面的Repositories,將這三個倉庫Apache Snapshots,Codehaus Snapshots,Maven Central的Download Remote Indexes修改爲true。然後在這三個倉庫上分別右鍵,選擇Repair-index,這樣Nexus就會去下載遠程的索引文件。
7.修改maven對應本地庫的setting.xml,添加如下內容
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>Nexus</name>
<url>http://127.0.0.1:8080/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>Nexus</name>
<url>http://127.0.0.1:8080/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>