nexus的安裝和簡介
下載nexus
Nexus 是Maven倉庫管理器,通過nexus可以搭建maven倉庫,同時nexus還提供強大的倉庫管理功能,構件搜尋功能等。
下載Nexus, 下載地址:http://www.sonatype.org/nexus/archived/
下載:nexus-2.12.0-01-bundle.zip
安裝 :
1.解壓,進入指定的目錄
2.安裝並啟動這個應用程式
cmd進入nexus解壓後bin目錄(D:\nexus\nexus-2.12.0-01\bin)
安裝成功在服務中檢視有nexus服務:
解除安裝nexus
cmd進入nexus的bin目錄,執行:nexus.bat uninstall
檢視window服務列表nexus已被刪除。
啟動nexus
方法1:
cmd進入bin(你解壓的nexus的bin)目錄,執行nexus.bat start
方法2:
直接啟動nexus服務
檢視nexus的配置檔案
# Jetty section
application-port=8081 # nexus的訪問埠配置
application-host=0.0.0.0 # nexus主機監聽配置(不用修改)
nexus-webapp=${bundleBasedir}/nexus # nexus工程目錄
nexus-webapp-context-path=/nexus # nexus的web訪問路徑
# Nexus section
nexus-work=${bundleBasedir}/../sonatype-work/nexus # nexus倉庫目錄
runtime=${bundleBasedir}/nexus/WEB-INF # nexus執行程式目錄
Nexus介紹
訪問:
http://localhost:8081/nexus/
使用Nexus 內建賬戶admin/admin123登陸:
點選右上角的Log in,輸入賬號和密碼 登陸
登陸成功:
nexus的倉庫有4種類型:
- hosted,宿主倉庫,部署自己的jar到這個型別的倉庫,包括releases和snapshot兩部分,Releases公司內部發布版本倉庫、 Snapshots 公司內部測試版本倉庫
2.proxy,代理倉庫,用於代理遠端的公共倉庫,如maven中央倉庫,使用者連線私服,私服自動去中央倉庫下載jar包或者外掛。
3.group,倉庫組,用來合併多個hosted/proxy倉庫,通常我們配置自己的maven連線倉庫組。
4.virtual(虛擬):相容Maven1 版本的jar或者外掛
nexus倉庫預設在sonatype-work目錄中:
central:代理倉庫,代理中央倉庫
apache-snapshots:代理倉庫
儲存snapshots構件,代理地址https://repository.apache.org/snapshots/
central-m1:virtual型別倉庫,相容Maven1 版本的jar或者外掛
releases:本地倉庫,儲存releases構件。
snapshots:本地倉庫,儲存snapshots構件。
thirdparty:第三方倉庫
public:倉庫組