CentOS安裝nexus

來源:互聯網
上載者:User

標籤:centos搭建nexus

1, Nexus 下載

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

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


nexus有兩種安裝實現方式,一種是war包的方式,將它直接放在例如tomcat下就可以啟用的,還有一種源碼的方式,做為一個營運還是喜歡源碼方式的說哈。開始吧。。。



2, Nexus 安裝

 解壓tar.gz檔案: 

#cd /home/tools

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

移動目錄

#mv nexus-2.4.0-09 /usr/local/nexus


3, Nexus 啟動

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

#cd /usr/local/nexus/bin

#./nexus

出現如下選項:



[[email protected] bin]# ./nexus

Usage: ./nexus { console | start | stop | restart | status | dump }


啟動nexus:

#./nexus  start



關閉nexus: 

#./nexus  stop



4, Nexus 驗證

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

650) this.width=650;" src="http://img.blog.csdn.net/20130527004154533" style="margin:0px;padding:0px;border:none;vertical-align:top;" alt="20130527004154533" />


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


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



5.設定

1.點擊左側 Repositories將所有Type 是 proxy 的 configuration配置選項中的 Download Remote Index 配置改為 True

  如果需要代理將配置最下面的Override Http Proxy Setting 勾上並填寫Proxy 伺服器地址和連接埠,最後儲存設定

2.然後在列表中分別右鍵點擊 ReIndex

3、添加自己的jar到nexus

  選中 3rd party , Artifact Upload 標籤

  GAV Definition 選擇GAV Parameters

  填寫 Group Artifact version packaging

  然後選擇jar包 上傳提交即可。




nexus私服linux搭建問題

2、這時候提示:

****************************************
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.


大概意思就是要在環境配置export RUN_AS_USER=root,臨時配置

在命令列下輸入:

export RUN_AS_USER=root

然後執行,就不會再提示了
./nexus start


3、也可以在系統裡面永久配置

vi /etc/profile  加入export RUN_AS_USER=root


三、啟動之後查看日誌(日誌路徑:nexus/logs)

報:

wrapper  | Reloading Wrapper configuration...
wrapper  | Launching a JVM...
wrapper  | JVM exited while loading the application.
jvm 5    | Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonatype/nexus/bootstrap/jsw/JswLauncher : Unsupported major.minor version 51.0
jvm 5    |     at java.lang.ClassLoader.defineClass1(Native Method)
jvm 5    |     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
jvm 5    |     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
jvm 5    |     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
jvm 5    |     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
jvm 5    |     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
jvm 5    |     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
jvm 5    |     at java.security.AccessController.doPrivileged(Native Method)
jvm 5    |     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
jvm 5    |     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
jvm 5    |     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
jvm 5    |     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
jvm 5    | Could not find the main class: org.sonatype.nexus.bootstrap.jsw.JswLauncher.  Program will exit.
wrapper  | There were 5 failed launches in a row, each lasting less than 300 seconds.  Giving up.
wrapper  |   There may be a configuration problem: please check the logs.
wrapper  | <-- Wrapper Stopped


網上解釋是要JAVA7才行。


CentOS安裝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.