一、安装JDK
http://blog.csdn.net/a286352250/article/details/51601664
二、下载Nexus
http://www.sonatype.com/download-oss-sonatype
三、上传至/home/目录
四、启动Nexus
#启动
sh /home/nexus-2.13.0-01/bin/nexus start;
#查看状态
sh /home/nexus-2.13.0-01/bin/nexus status;
#停止
sh /home/nexus-2.13.0-01/bin/nexus stop;
五、异常
If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script.
/etc/profile
加入
export RUN_AS_USER=root
生效profile
source /etc/profile
六、代码自动发布Nexus
修改maven/conf/settings.xml
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
工程pom.xml
<!-- 代码自动发布到私服 -->
<distributionManagement>
<repository>
<id>nexus-releases</id>
<url>http://192.168.1.91:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://192.168.1.91:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
添加防火墙
firewall-cmd --zone=public --add-port=8081/tcp --permanent;
firewall-cmd --reload;
网址:
http://192.168.2.62:8081/nexus/#welcome