最近尝试了一下本身安装nexus服务,给本身搭一下开发环境,主要参考官网的安装手册:java
须要先安装 java jdk。shell
1.下载 nexus vim
去官网下载一个最新的tar包app
http://www.sonatype.org/nexus/go/this
2.解压包spa
$ tar xvzf nexus-2.12.0-01-bundle.tar.gz $ mv nexus-2.12.0-01-bundle /usr/local/ $ ls -s nexus-2.12.0-01 nexus $ groupadd nexus $ adduser -g nexus nexus $ chmod 755 -R nexus $ chown -R nexus nexus $ chgrp -R nexus neuxs # 设置 NEXUS_HOME $ vim /usr/profile # add NEXUS_HOME=/usr/local/nexus $ resource profile $ cp /usr/local/nexus/bin/nexus /ect/init.d/ $ chmod 755 nexus $ chown root nexus # 修改 nexus NEXUS_HOME=/usr/local/nexus RUN_AS_USER=nexus $ vim nexus # 修改nexus.properties 自定义端口之类的 $ vim /usr/local/nexus/conf/nexus.properties # 增长nexus-work=${bundleBasedir}/../sonatype-work/nexus中的目录 $ cd /usr/local $ mkdir -p sonatype-work/nexus $ chown -R nexus sonatype-work $ chmod 755 sonatype-work
此时若是用 root 用户会提示如下信息:code
# **************************************** # 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.
配置服务:orm
$ cd /etc/init.d $ chkconfig --add nexus $ chkconfig --levels 345 nexus on # 切换至 nexus用户执行 $ su nexus $ service nexus start Starting Nexus Repository Manager... $ tail -f /usr/local/nexus/logs/wrapper.log
此时会报如下错误:ip
wrapper | Unable to start JVM: No such file or directory (2) wrapper | JVM exited while loading the application.
这个时候要修改wrap.properties中的 wrapper.java.command参数为java命令的绝对路径:开发
$ vim /usr/local/nexus/bin/jsw/conf/wrapper.conf # 设置 wrapper.java.command=/usr/local/jdk1.8.0_60/bin/java
而后启动nexus