搭建Maven私服

安装Nexus服务的文档可以参考官方站点:http://www.sonatype.com/books/nexus-book/reference/install-sect-install.html


1.下载并安装Nexus
在Ubuntu 11.10 server上,下载Nexus最新版本。和官方文档不一样的地方是,我将nexus放在了/usr而不是/usr/local目录下。
wget http://nexus.sonatype.org/downloads/nexus-oss-webapp-1.9.2.4-bundle.tar.gz
mv nexus-oss-webapp-1.9.2.4-bundle.tar.gz /usr/
cd /usr
tar zxvf nexus-oss-webapp-1.9.2.4-bundle.tar.gz
ln -s nexus-oss-webapp-1.9.2.4 nexus


为了日后方便,按照官方文档的方式设置一个环境变量,将下面的脚本添加到~/.bashrc文件最后
export NEXUS_HOME=/usr/nexus

2.运行

进入/usr/nexus-oss-webapp-1.9.2.4/bin/jsw/linux-x86-64目录,运行下面的命令:

./nexus start
Starting Nexus OSS...
Started Nexus OSS.

默认nexus采用内置jetty作为web服务器,监听本地端口8081.通过打开网页 http://yourserver:8081/nexus进行测试,用户名和密码默认是:admin/admin123


3.创建系统服务

复制Nexus自带的脚本到/etc/init.d目录

root@ubuntu1110:/etc/init.d# cp $NEXUS_HOME/bin/jsw/linux-x86-64/nexus ./
添加几个变量到nexus脚本中NEXUS_HOME=/usr/nexusPLATFORM=linux-x86-64JAVA_HOME=/usr/jdk1.6.0_30PATH="$JAVA_HOME/bin:$PATH修改几个变量的值:APP_NAME=nexusAPP_LONG_NAME=Sonatype Nexus# WrapperWRAPPER_CMD=$NEXUS_HOME/bin/jsw/$PLATFORM/wrapperWRAPPER_CONF=$NEXUS_HOME/bin/jsw/conf/wrapper.conf
# Location of the pid file.
PIDDIR=/var/run


这个修改后的脚本要好好保存,这种事情再干一次很无聊。
之后,运行命令:
root@ubuntu1110:/etc/init.d# update-rc.d nexus defaults
update-rc.d: warning: /etc/init.d/nexus missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/nexus ...
/etc/rc0.d/K20nexus -> ../init.d/nexus
/etc/rc1.d/K20nexus -> ../init.d/nexus
/etc/rc6.d/K20nexus -> ../init.d/nexus
/etc/rc2.d/S20nexus -> ../init.d/nexus
/etc/rc3.d/S20nexus -> ../init.d/nexus
/etc/rc4.d/S20nexus -> ../init.d/nexus
/etc/rc5.d/S20nexus -> ../init.d/nexus


Ok.现在可以通过service nexus start启动,

然后通过tail -f /usr/nexus/logs/wrapper.log 来检查启动状态。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值