Linux 搭建Nexus和Maven

來源:互聯網
上載者:User

Maven 安裝請見我先前的部落格: Linux 搭建 maven

1, Nexus 下載

Nexus 官方下載, 最新版下載: nexus-2.4.0-09-bundle.tar.gz

Nexus war下載: nexus-2.4.0-09.war

2, Nexus 安裝

(1) 建立解壓檔案夾: 

mkdir nexus-2.4.0-09

(2) 解壓tar.gz檔案: 

tar zxvf nexus-2.4.0-09-bundle.tar.gz -C nexus-2.4.0-09

註: nexus-2.4.0-09 內有兩個檔案夾 nexus-2.4.0-09 和 sonatype-work

(3) 拷貝至/opt/目錄下:

sudo mv nexus-2.4.0-09 /opt/

3, Nexus 啟動

nexus啟動是在bin目錄下,首先看一下啟動/關閉/重啟等命令, 輸入命令:

/opt/nexus-2.4.0-09/nexus-2.4.0-09/bin/nexus

出現如下選項:

啟動nexus:

/opt/nexus-2.4.0-09/nexus-2.4.0-09/bin/nexus  start


關閉nexus: 

/opt/nexus-2.4.0-09/nexus-2.4.0-09/bin/nexus  stop

4, Nexus 驗證

啟動nexus後,在瀏覽器輸入地址: http://localhost:8081/nexus

出現上述頁面,說明配置nexus成功!

點擊右上方“Log in”, 輸入使用者名稱和密碼(預設使用者名:admin      密碼: admin123)登入

開啟遠程索引
新搭建的neuxs環境只是一個空的倉庫,需要手動和遠程中心庫進行同步,nexus預設是關閉遠程索引下載,最重要的一件事情就是開啟遠程索引下載。登陸nexus系統,預設使用者名密碼為admin/admin123。
點擊左邊Administration菜單下面的Repositories,找到右邊倉庫列表中的三個倉庫Apache Snapshots、Codehaus Snapshots、Central,然後在每一個倉庫的configuration下把Download Remote Indexes修改為true。然後在這三個倉庫上分別右鍵,選擇Repair Index,這樣Nexus就會去下載遠端索引檔案。

啟用第三方(3th party) Deployment Policy 為 Allow Redeploy

[root@localhost bin]# ./nexus start
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script.

修改vi ./bin/nexus 的 RUN_AS_USER=root

參考推薦:

Installing Nexus OSS(官方)

Maven 向私服nexus上傳jar  

使用nexus搭建maven私服

nexus 命令上傳jar包

Repository Management with Nexus (推薦)

使用Nexus建立私服

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.