Nexus
Nexus 是一个强大的 Maven 仓库管理器
,它极大地简化了自己内部仓库的维护和外部仓库的访问
。
官方 maven 仓库:
http://repo.maven.apache.org
https://www.sonatype.com/download-oss-sonatype
官方下载页面
https://help.sonatype.com/repomanager3/download
https://help.sonatype.com/repomanager3/download/download-archives—repository-manager-3
部署 nexus
内存推荐 4G 或以上
内存太小会出现以下错误
root@nexus-server:/usr/local/nexus# ./bin/nexus run
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Java HotSpot(TM) 64-Bit Server VM warning: INFO:
os::commit_memory(0x0000000717000000, 1890582528, 0) failed; error='Cannot
allocate memory' (errno=12)
启动 nexus
root@nexus-server:/usr/local/src# tar xf nexus-3.20.1-01-unix.tar.gz
root@nexus-server:/usr/local/src# ln -sv /usr/local/src/nexus-3.20.1-01 /usr/local/nexus
root@nexus-server:/usr/local/src# cd /usr/local/nexus
# ./bin/nexus --help
# ./bin/nexus run
# ./bin/nexus start
登录 web 界面
设置向导
设置密码
匿名下载:
启用匿名访问将默认允许未经授权的下载,浏览和搜索存储库内容,可以通过编辑分配给匿名用户的角色来更改未经身份验证的用户的权限
验证默认仓库
https://github.com/pdurbin/maven-hello-world.git
使用 nexus 示例
内网 yum 源示例
通过 nexus 作为公司内网 yum 仓库,通过阿里云镜像安装包
阿里云镜像地址
https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/x86_64/
Create repository—yum(proxy)
centos 7.x 配置 yum 仓库
cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@localhost ~]# cat /etc/yum.repos.d/zabbix.repo
[zabbix-nexus]
name=zabbix
baseurl=http://172.31.0.105:8081/repository/zabbix-proxy/
enabled=1
gpgcheck=0
centos7.x 安装 zabbix 测试:
yum install zabbix-agent zabbix-get --nogpgcheck
验证 nexus 数据