linux 环境搭建 nexus 私服

来源:互联网 发布:武汉国企java招聘信息 编辑:程序博客网 时间:2024/06/07 14:34

1、前言

maven 使用咱们就不多说。那为什么要搭建私服呢?
1、假如我们不用我们的私服,我们项目依赖的jar更新时候都要去中央仓库里获取,慢!慢!一个团队都重复这样的工作何谈效率?
2、另外一点就是、方便我们自己团队的插件、组件管理。比如A小组使用B小组的组件、B小组会不断更新B开发的组件,A只管更新就ok,利于协作开发。

2、 nexus 私服搭建

2.1 nexus下载
http://www.sonatype.org/nexus/archived/#step2top
我使用的是Nexus 2.12.0-01版本的;

2.2 上传安装包
用xshell工具、连接到linux服务器
使用

  rz

2.3 解压

tar -zxvf nexus-2.12.0-01-bundle.tar.gz[root@localhost nexus# lsnexus-2.12.0-01  nexus-2.12.0-01-bundle.tar.gz  sonatype-work

nexus-2.12.0-01 是 nexus 核心文件; sonatype-work是用来存放jar包

2.4 修改启动用户

[root@localhost nexus]# cd nexus-2.12.0-01 [root@localhost nexus-2.12.0-01]# cd bin[root@localhost bin]# lsjsw  nexus  nexus.bat[root@localhost bin]# cp nexus nexus.bak[root@localhost bin]# vi nexus

将RUN_AS_USER修改为root,不推荐使用root。

保存之后,再次启动nexus,运行命令

[root@localhost bin]# ./nexus start [root@localhost bin]# ./nexus console****************************************WARNING - NOT RECOMMENDED TO RUN AS ROOT****************************************Running Nexus OSS...Nexus OSS is already running.

Nexus OSS is already running. 表示nexus运行成功;
默认端口8081
默认用户admin 密码 admin123

这里写图片描述

最后:

设置软连接

ls -s /usr/local/nexus/nexus-2.12.0-01/bin/nexus /etc/init.d/nexus

这里写图片描述

设置开机启动

chkconfig --add nexus

查看开机

chkconfig --list
原创粉丝点击