1、创建 /opt/nexus
目录
2、下载安装包:https://help.sonatype.com/repomanager3/product-information/download/download-archives---repository-manager-3 到/opt/nexus
目录并进行解压
3、进入到/opt/nexus/nexus-3.46.0-01/bin
目录执行./nexus start
root@nianyu-virtual-machine:/opt# mkdir nexus && cd nexus
root@nianyu-virtual-machine:/opt# tar -zxvf nexus-3.46.0-01-unix.tar.gz
root@nianyu-virtual-machine:/opt# su nexus
nexus@nianyu-virtual-machine:/opt$ cd nexus/nexus-3.46.0-01/bin
nexus@nianyu-virtual-machine:/opt/nexus/nexus-3.46.0-01/bin$ ./nexus start
Starting nexus
建议使用专门的用户来部署,不要以 root 用户运行 Nexus Repository Manager 3。
4、启动后,可以在/opt/nexus/sonatype-work/nexus3/log/nexus.log
查看日志,看到Started Sonatype Nexus OSS 3.46.0-01
字样说明启动成功。
5、打开浏览器访问http://localhost:8081/
,点击 Sign in 可以查看初始密码路径,复制密码进行登录。

6、登录后,按照指引进行Setup,完成修改密码及匿名用户访问控制。
问题记录:
出现原因:最初以root运行nexus,看到一个警告“Detected execution as "root" user. This is NOT recommended!”。所以停止了nexus服务,试图用nexus用户重新启动,但它没有重新启动。原因是,当第一次以root用户运行nexus时,它以root用户创建了一些缓存文件和日志文件。
解决:chown -R nexus:nexus /opt/nexus
https://help.sonatype.com/repomanager3
https://hub.docker.com/r/sonatype/nexus3/
网友评论