Centos+Sonatype Nexus 搭建Maven私有库

必要环境:Centos,JDK7,Maven,Sonatype Nexus
IP:192.168.25.135 /root 确保JDK已经成功安装并且配置好环境变量
1.下载Sonatype Nexus:
https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.11.2-03-bundle.tar.gz
2.解压:
- 创建解压文件所需要的目录并解压文件到该目录
# mkdir nexus
# tar -zxvf nexus-2.11.2-03-bundle.tar.gz -C nexus
# cd nexus
# ls (可以看到有两个目录)
nexus-2.11.2-03(存放nexus服务目录) sonatype-work(存放私有库目录)
- 编辑nexus-2.11.2-03的nexus.properties文件
# cd nexus-2.11.2-03/conf
# vi nexus.properties

# Sonatype Nexus
# ==============
# This is the most basic configuration of Nexus.

# 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
  • 编辑 nexus 脚本, 配置 RUN_AS_USER 参数
    #RUN_AS_USER=
    改为:
    RUN_AS_USER=root
  • 打开防火墙的8081端口,与上面所修改的一致
    # vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

# 打开8081端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
  • 启动nexus:
    进入到nexus的bin目录:cd /root/nexus/nexus-2.11.2-03/bin
    启动: ./nexus start
    ******************************
    WARNING - NOT RECOMMENDED TO RUN AS ROOT
    ******************************
    Starting Nexus OSS…
    Started Nexus OSS.
  • 访问nexus http://192.168.25.135:8081/nexus
    可以看到如下页面
  • 此时,一个Maven的私有库就搭建完成了。下一篇将说一下如何通过在IDE中配置和访问私有库
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值