一、最近搭建nexus私服,从官网下载下来总是报503服务器无效,很是无奈,最后在网上找到一个可以用的 收藏起来,这里给大家共享一下
下载地址:http://pan.baidu.com/s/1kT3UJHl
二、解压之后会有两个文件夹,nexus-2.6.0-05和sonatype-work,我们进入第一个文件夹的bin目录来启动nexus 。
1、进入启动目录,启动
cd nexus-2.6.0-05/bin/
./nexus start
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才行。唉只能下个低版本了。
四、重新下了个nexus-oss-webapp-1.9.2.4-bundle.zip 版本。
解压/opt/nexus1924/bin/jsw/linux-x86-64 目录下启动就可以访问了。
http://192.168.13.31:8081/nexus
默认管理员用户名/密码: admin/admin123
五、参考
http://blog.youxey.com/archives/293.html
http://blog.csdn.net/shandian534/article/details/8987349 Nexus 安装与配
http://snowolf.iteye.com/blog/1605811 Maven零散笔记——配置Nexus
http://www.blogjava.net/javalinjx/archive/2013/08/21/403110.html linux系统之上搭建maven 之nexus服务篇
http://wenku.baidu.com/view/a9a0618acc22bcd126ff0c4a.html Nexus入门指南(图文)
原文来源:http://blog.csdn.net/cuker919/article/details/12052565