私服建设(一)搭建

下载Nexus 网址:http://www.sonatype.org
解压文件nexus-2.6.4-02
修改配置文件:nexus-2.6.4-02\bin\jsw\conf\wrapper.conf
# Set the JVM executable
# (modify this to absolute path if you need a Java that is not on the OS path)
wrapper.java.command=java

# Set the JVM executable
# (modify this to absolute path if you need a Java that is not on the OS path)
wrapper.java.command=C:\Program Files\Java\jdk1.6.0_45\bin\java


可以执行启动命令:nexus-2.6.4-02\bin\nexus start
报错:

wrapper | OpenSCManager failed - 拒绝访问。(0x5)

查找原因 : http://blog.csdn.net/ybw2011/article/details/7690710

runas /user:administrator cmd
输入密码,出现窗口再次执行命令,又出现错误
wrapper  | The nexus-webapp service is not installed - 指定的服务未安装。 (0x424)
查找原因:没有安装
所以先执行 :nexus install
再执行启动: nexus start
nexus install
wrapper  | nexus installed.
nexus start
E:\nexus-2.6.4-02\bin>nexus start
wrapper  | Starting the nexus service...
wrapper  | Waiting to start...
wrapper  | Waiting to start...
wrapper  | Waiting to start...
wrapper  | The nexus service was launched, but failed to start.

看不到错误,查看配置文件,发现有log配置
打开配置日志:
# ********************************************************************
# Wrapper Logging Properties
# ********************************************************************
# Enables Debug output from the Wrapper.
#wrapper.debug=TRUE

# Format of output for the console.  (See docs for formats)
wrapper.console.format=PM

# Log Level for console output.  (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=../logs/wrapper.log

# Format of output for the log file.  (See docs for formats)
wrapper.logfile.format=LPTM

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
#wrapper.logfile.maxsize=0

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
#wrapper.logfile.maxfiles=0

# Log Level for sys/event log output.  (See docs for log levels)
#wrapper.syslog.loglevel=NONE

再次启动,同样的错误停止,找到日志位置查看日志
jvm 5    | 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.
jvm 5    | Exception in thread "main" 

升级JVM版本到1.7
# Set the JVM executable
# (modify this to absolute path if you need a Java that is not on the OS path)
wrapper.java.command=C:\Program Files\Java\jdk1.7.0_45\bin\java


再次启动服务
E:\nexus-2.6.4-02\bin>nexus start
wrapper  | Starting the nexus service...
wrapper  | Waiting to start...
wrapper  | Waiting to start...
wrapper  | Waiting to start...
wrapper  | Waiting to start...
wrapper  | nexus started.


好像是没有问题了,试一下网址:http://localhost:8081/nexus/index.html#welcome
好了出现主界面。点击右上角login 用 admin/admin123 进行登录,左边菜单树有变化了,基本安装完成了!

猜你喜欢

转载自jameswolf.iteye.com/blog/1977539