-
安裝nexus,這裏就不贅述,本文主要講述開機啓動項配置
1.vim 打開 nexus 入口程序文件
2.配置JDK目錄,原本是註釋了的,需要放開進行配置,保存退出
3.創建nexus服務配置文件
vim /etc/systemd/system/nexus.service
輸入以下內容,紅色部分自行調整
[Unit]
Description=nexus service
After=network.target[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/usr/local/nexus/nexus-3.9.0-01/bin/nexus start
ExecStop=/usr/local/nexus/nexus-3.9.0-01/bin/nexus stop
User=nexus
Restart=on-abort[Install]
WantedBy=multi-user.target
4.刷新 系統配置文件,開啓自啓動
sudo systemctl daemon-reload // 刷新配置
sudo systemctl enable nexus.service //設置自啓動
sudo systemctl start nexus.service //啓動服務