一、下载 nexus
https://help.sonatype.com/repomanager3/download
选择对应操作系统版本
系统要求:
安装 jdk 1.8 版本
linux 系统需要修改 nexus 用户最大文件打开数:
修改 /etc/security/limits.conf,增加一行:nexus - nofile 65536 ,其中 nexus 为要运行 nexus 服务的用户。如果是使用 Ubuntu,它是忽略 /etc/security/limits.conf 配置的,如果进程是由 init.d 启动,可以编辑 /etc/pam.d/common-session ,去掉这一行的注释:# session required pam_limits.so
如果是用 systemd 则需要在服务配置中添加一个 LimitNOFILE 配置:
[Unit]
Description=nexus service
After=network.target
[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus # 这个用户请保持和实际要运行 nexus 的用户一致
Restart=on-abort
[Install]
WantedBy=multi-user.target
二、部署
1、解压缩 nex