https://www.sonatype.com/download-oss-sonatype 選擇對應的版本下載,以nexus-3.6.0-02-win64(https://www.sonatype.com/oss-thank-you-win64.zip)爲例;app
將nexus-3.6.0-02-win64.zip解壓至對應目錄;maven
...\nexus-3.6.0-02-win64\nexus-3.6.0-02\bin>nexus.exe /runurl
配置文件位於:\etc\nexus-default.propertiesspa
...\nexus-3.6.0-02-win64\nexus-3.6.0-02\bin>nexus.exe /install nexusorm
URL:http://localhost:8091/nexus;server
點擊右上角Sign in 按鈕登陸。默認用戶名:admin,密碼:admin123;xml
點擊齒輪狀配置按鈕,進入配置頁面;ip
上述兩種方式都可;資源
settings.xml增長以下配置:get
<localRepository>D:\...\repository-dev</localRepository>
<mirror>
<id>nexus-public</id>
<mirrorOf>central</mirrorOf>
<name>Nexus Repository</name>
<url>http://<Host>:8091/nexus/repository/maven-public/</url>
</mirror>
<server>
<id>nexus-releases</id>
<username>dev</username>
<password>123456</password>
</server>
<server>
<id>nexus-snapshot</id>
<username>dev</username>
<password>123456</password>
</server>
POM 文件修改實例:
<repositories> <repository> <id>nexus-public</id> <name>nexus-public</name> <url>http://<Host>:8091/nexus/repository/maven-public/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </repository> </repositories> <distributionManagement> <repository> <id>nexus-nexus</id> <name>Releases</name> <url>http://<Host>:8091/nexus/repository/maven-releases/</url> </repository> <snapshotRepository> <id>nexus-nexus</id> <name>Snapshot</name> <url>http://<Host>:8091/nexus/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement>
-------------------------------------------------------------------------------------------------------------
本地私庫便可從遠程倉庫下載資源了: