安装
useradd -s /sbin/nologin nexus;\
wget -cP /tmp/ https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/3/nexus-3.13.0-01-unix.tar.gz;\
mkdir /opt/nexus;\
tar xf /tmp/nexus-3.13.0-01-unix.tar.gz -C /opt/nexus/;\
chown -R nexus. /opt/nexus
添加系统服务
tee /etc/systemd/system/nexus.service << 'EOF'
[Unit]
Description=nexus service
After=network.target
[Service]
Environment="JAVA_HOME=/usr/java/jdk1.8.0_181-amd64"
Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus/nexus-3.13.0-01/bin/nexus start
ExecStop=/opt/nexus/nexus-3.13.0-01/bin/nexus stop
User=nexus
Restart=on-abort
[Install]
WantedBy=multi-user.target
EOF
启动
systemctl daemon-reload;\
systemctl enable nexus;\
systemctl start nexus;\
systemctl status nexus
防火墙
firewall-cmd --add-port=8081/tcp --permanent;\
firewall-cmd --reload
默认账号
admin/admin123
Maven私库
NPM私库
https://help.sonatype.com/repomanager3/node-packaged-modules-and-npm-registries