安装教程导航:https://lushunde.blog.csdn.net/article/details/104280861
安装教程导航:https://lushunde.blog.csdn.net/article/details/104281476
官网下载地址:https://www.sonatype.com/download-oss-sonatype
[root@iZ4zeaehxxqhrn553tblkkZ /]# mkdir /home/work/nexus
[root@iZ4zeaehxxqhrn553tblkkZ nexus]# rz
[root@iZ4zeaehxxqhrn553tblkkZ /]# cd /home/work/nexus
[root@iZ4zeaehxxqhrn553tblkkZ maven]# tar -zxvf nexus-3.6.0-02-unix.tar.gz
[root@iZ4zeaehxxqhrn553tblkkZ /]# cd /home/work/nexus/nexus-3.6.0-02/bin/
[root@iZ4zeaehxxqhrn553tblkkZ bin]# ./nexus run &
出现以下日志的时候表示启动成功,第一次启动比较慢。
-------------------------------------------------
Started Sonatype Nexus OSS 3.6.0-02
-------------------------------------------------
nexus 默认web端口8081
[root@iZ4zeaehxxqhrn553tblkkZ bin]# firewall-cmd --zone=public --add-port=8081/tcp --permanent
[root@iZ4zeaehxxqhrn553tblkkZ bin]# firewall-cmd --reload
[root@iZ4zeaehxxqhrn553tblkkZ bin]# vim /usr/lib/systemd/system/nexus.service
内容如下:
[Unit]
Description=nexus service
[Service]
Type=forking
LimitNOFILE=65536 #警告处理
ExecStart=/home/work/nexus/nexus-3.6.0-02/bin/nexus start
ExecReload=/home/work/nexus/nexus-3.6.0-02/bin/nexus restart
ExecStop=/home/work/nexus/nexus-3.6.0-02/bin/nexus stop
Restart=on-failure
[Install]
WantedBy=multi-user.target
[root@iZ4zeaehxxqhrn553tblkkZ bin]# systemctl enable nexus.service
[root@iZ4zeaehxxqhrn553tblkkZ bin]# systemctl daemon-reload
[root@iZ4zeaehxxqhrn553tblkkZ bin]# vim nexus.rc
run_as_user="root"
···
[root@iZ4zeaehxxqhrn553tblkkZ bin]# vim nexus
···
修改内容:
···
INSTALL4J_JAVA_HOME_OVERRIDE=/home/work/java/jdk1.8.0_144
···
[root@iZ4zeaehxxqhrn553tblkkZ bin]# cd /home/work/nexus/nexus-3.6.0-02/etc/
[root@iZ4zeaehxxqhrn553tblkkZ etc]# vim nexus-default.properties
修改内容:
application-port=8081
[root@iZ4zeaehxxqhrn553tblkkZ etc]# cd /usr/local/nexus-3.6.0-02/bin/
[root@iZ4zeaehxxqhrn553tblkkZ bin]# vim nexus.vmoptions
修改内容:
-XX:LogFile=./sonatype-work/nexus3/log/jvm.log
-Dkaraf.data=./sonatype-work/nexus3
-Djava.io.tmpdir=./sonatype-work/nexus3/tmp
nexus
*
http://192.168.0.123:8081/repository/maven-public/
mvn deploy:deploy-file -DgroupId= \
-DartifactId= \
-Dversion= \
-Dpackaging= \
-Dfile= \
-DrepositoryId= \
-Durl=
mvn deploy:deploy-file -DpomFile= \
-Dfile= \
-DrepositoryId= \
-Durl=