Centos7 安装 nexus2

 

1.下载nexus

https://www.sonatype.com/download-oss-sonatype

Centos7 安装 nexus2_第1张图片

2.解压到 /usr/local/nexus,有两个文件

tar -zxvf nexus-3.13.0-01-unix.tar.gz -C /usr/local/nexus

 Centos7 安装 nexus2_第2张图片

3、在/lib/systemd/system目录下创建nexus.service文件

vim nexus.service

 内容如下:

[Unit]
Description=nexus
After=network.target
[Service]
Type=forking
Environment=RUN_AS_USER=root
Environment=PATH=/usr/local/jdk1.8.0_241/bin:/usr/local/jdk1.8.0_241/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin
ExecStart=/usr/local/nexus/nexus-3.13.0-01/bin/nexus start
ExecReload=/usr/local/nexus/bin/nexus restart
ExecStop=/usr/local/nexus/bin/nexus stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target

 Exec...是你放nexus的路径

4、刷新服务

systemctl daemon-reload

5、启动服务

systemctl start nexus

6、设置开机启动

systemctl enable nexus

7.登录nexus,IP+8081(nexus默认8081),管理员账号密码默认admin123,admin123

Centos7 安装 nexus2_第3张图片

你可能感兴趣的:(Linux)