nexus搭建maven私服

来源:互联网 发布:java开源代码论坛 编辑:程序博客网 时间:2024/06/03 18:38

下载安装包nexus-latest-bundle.tar.gz,上传到linux服务器
解压:tar -zxvf nexus-latest-bundle.tar.gz
把解压得到的两个文件夹放到一个新建的文件夹nexus-2.11下:
这里写图片描述

启动nexus:

cd nexus-2.11.1-01/bin/./nexus start

修改防火墙,打开8081端口,在iptables中添加一行:
-A INPUT -m state –state NEW -m tcp -p tcp –dport 8081 -j ACCEPT

cd /etc/sysconfig/vi iptables

这里写图片描述
打开浏览器,访问http://服务器ip:8081/nexus
这里写图片描述
右上角log in,admin/admin123,

1. 添加一个代理仓库:
这里写图片描述
这里写图片描述
这里写图片描述
管理添加的仓库
这里写图片描述
这里写图片描述

2.上传第三方jar包
这里写图片描述
这里写图片描述

3.本地工程发布到maven私服中
这里写图片描述
需要在pom.xml中添加以下配置,再deploy

<!--配置本地工程发布到snapshot、release的路径-->    <distributionManagement>        <repository>            <id>nexus-releases</id>            <name>nexus-releases</name>            <url>http://192.168.56.101:8900/nexus/content/repositories/releases/</url>        </repository>        <snapshotRepository>            <id>nexus-snapshots</id>            <name>nexus-snapshots</name>            <url>http://192.168.56.101:8900/nexus/content/repositories/snapshots/</url>        </snapshotRepository>    </distributionManagement>

参考:
http://www.cnblogs.com/h–d/p/5717920.html
http://blog.csdn.net/sinat_34017357/article/details/51776641
http://blog.csdn.net/qq383264679/article/details/50880003
http://blog.csdn.net/shenshen123jun/article/details/9084293

原创粉丝点击