持续集成篇_04_maven私有库和本地库的安装与配置(sonatype nexus + maven)

1.下载Nexus
[root@localhost ~]# wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.11.2-03-bundle.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg  Desktop  Documents  Downloads  dubbo-governance.log  install.log  install.log.syslog  log.log  Music  nexus-2.11.2-03-bund
2.解压
[root@localhost ~]# mkdir nexus
[root@localhost ~]# tar -zxvf nexus-2.11.2-03-bundle.tar.gz -C nexus
[root@localhost nexus]# ls
nexus-2.11.2-03  sonatype-work
(一个是nexus服务,一个私有库目录)
[root@localhost nexus]# 
3.编辑Nexus的nexus.properties,配置端口和work目录信息(保留默认)


[root@localhost nexus]# cd nexus-2.11.2-03/
[root@localhost nexus-2.11.2-03]# ls
bin  conf  lib  LICENSE.txt  logs  nexus  NOTICE.txt  tmp
[root@localhost nexus-2.11.2-03]# cd conf
[root@localhost conf]# vi nexus.properties 
此文件不需要修改,保留默认配置

# Jetty section
application-port=
8081
application-host=0.0.0.0
nexus-webapp=${bundleBasedir}/nexus
nexus-webapp-context-path=/nexus


# Nexus section
nexus-work=${bundleBasedir}/../sonatype-work/nexus
runtime=${bundleBasedir}/nexus/WEB-INF


4.编辑nexus脚本,配置RUN_AS_USER参数
[root@localhost conf]# vi /root/nexus/nexus-2.11.2-03/bin/nexus
#RUN_AS_USER改为
RUN_AS_USER=root


5.防火墙中打开8081端口
[root@localhost conf]# vi /etc/sysconfig/iptables
添加:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
保存后重启防火墙
[root@localhost conf]# service iptables restart


6.启动nexus
[root@localhost conf]# /root/nexus/nexus-2.11.2-03/bin/nexus start
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
Starting Nexus OSS...
Started Nexus OSS.
[root@localhost conf]# 


7.在浏览器中打开:
持续集成篇_04_maven私有库和本地库的安装与配置(sonatype nexus + maven)_第1张图片

8.登录,默认用户名,默认密码是admin123

持续集成篇_04_maven私有库和本地库的安装与配置(sonatype nexus + maven)_第2张图片


到此了!

你可能感兴趣的:(持续集成篇_04_maven私有库和本地库的安装与配置(sonatype nexus + maven))