nexus部署

一、下载部署

1.1 官方网站

下载地址

https://help.sonatype.com/repomanager3/product-information/download/download-archives---repository-manager-3

1.2 依赖

安装JDK1.8+

1.3 部署

tar -xf nexus-3.42.0-01-unix.tar.gz
#解压缩

useradd nexus -s /sbin/nologin -M
#创建nexus用户
cat << EOF > /usr/lib/systemd/system/nexus.service
[Unit]
Description=nexus service
After=network.target
  
[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/apps/nexus/bin/nexus start
ExecStop=/apps/nexus/bin/nexus stop
User=nexus
Restart=on-abort
TimeoutSec=600
  
[Install]
WantedBy=multi-user.target
EOF
#创建service文件

systemctl daemon-reload
systemctl enable --now nexus.service
#启动服务
#首次启动服务会比较慢,若使用nexus用户启动失败,更换为root用户。

1.4 登陆

http://192.168.1.1:8081

默认用户名admin。密码保存在文件中,根据提示查找。

二、使用

2.1 首次登陆设置

修改管理员用户密码。

设置匿名连接权限,开启。

2.2 仓库类型

Hosted:本地仓库

Proxy:代理仓库,它们被用来代理远程的公共仓库,如maven中央仓库。

Group:仓库组,用来合并多个Hosted/proxy仓库,当你的项目希望在多个repository使用资源时就不需要多次引用了,只需引用一个group即可。

标签: none

添加新评论