一、软件安装
地址:http://www.sonatype.org/nexus/thank-you-for-downloading/?dl=tgz
解压:
启动:
>> nexus start
打开:http://192.9.104.17:8081/nexus/#welcome
点击右上角,使用admin/admin123(默认管理员)登陆。
管理操作面板(修改代码库、镜像、用户权限管理等):
二、系统配置
默认的nexus 配置的镜像是无法使用的,需要我们把它设置为可行的,重新构建索引。
重新构建索引:
需要修改的仓库有三处:Central、Apache Snapshots、Codehaus Snapshots
另外,releases和snapshots两处的可以自动部署属性必须勾上,如下图:
当然,你也可以通过界面来上传jar包。
三、maven环境配置
1、确保你的环境中已经部署和正确配置了maven环境,具体如果安装maven不在此教程范畴之内。
2、到你当前登录的用户下的.m2目录下,创建一个setting.xml,内容如下:
snapshots likehua likehua releases likehua likehua tomcat-remote-deploy tomcat tomcat123 nexus * A Local Nexus Server http://192.9.104.17:8081/nexus/content/groups/public/ nexus true true nexus Repository for Local Nexus Server http://central default true true nexus Plugin Repository for Local Nexus Server http://central
主要注意修改:servers和mirrors两处,如本例所示:
servers:
snapshots likehua likehua releases likehua likehua tomcat-remote-deploy tomcat tomcat123
注意此处的用户名和密码,是你nexus上创建的用户名,一般付给部署的权限。
另外就是镜像地址的配置:
12 14 15 20nexus 16* 17A Local Nexus Server 18http://192.9.104.17:8081/nexus/content/groups/public/ 19
ok,maven私服搭建配置完成。